Many algorithms inspired by the simulated annealing paradigm for approximately solving combinatorial optimization problems have been presented and tested in the last years. The aim of this paper is to present a double-annealing algorithm, a new idea for the application of annealing-based algorithms to discrete location/allocation problems, with two mutually dependent sets of binary variables. The double annealing algorithm consists of two annealing processes synchronized with each other; each process is executed on a different subset of variables and with a different annealing parameter ("temperature") and the synchronization depends on the saturation of the two variable subsets. In order to improve such synchronization, deannealing steps are also performed. The double annealing algorithm is quite robust and easy to tune (it is rather insensitive to the initial values of the annealing parameters and to the initialization) and it is able to achieve good approximate solutions. The experiments were done on the P-median problem.