Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: atomic read in atomic_ops(9)



Le 26/12/11 01:26, Joerg Sonnenberger a écrit :
On Mon, Dec 26, 2011 at 01:01:01AM +0100, Jean-Yves Migeon wrote:
I encounter situations where I'd like to read a 64 bits value
atomically under a 32 bits platform (canonical example is Xen
balloon(4)), yet the current atomic_ops(9) functions do not provide
a stub for it.

Well, there is no general way to do atomic reads of 64bit values.
On x86, it is only possible with Pentium and newer systems (having
the cmpxchg extension). Other platforms are even more restrictive...

True. However, someone can expect a platform that offers CAS for 64 bits to also have atomic 64b reads. The latter is sometimes even faster, reads have less overhead than a CAS.

Jean-Yves


Home | Main Index | Thread Index | Old Index