Click to See Complete Forum and Search --> : InterlockedExchange64


superbonzo
October 11th, 2011, 09:01 AM
just a confirmation, to see if I didn' t miss something obvious;

InterlockedExchange64 performs atomically with respect to other InterlockedExchange64 calls also on 32 bit systems, doesn't it ?

I ask, because the msdn doc says "To operate on a 32-bit variable, use the InterlockedExchange function." that may be interpreted negatively ...

Codeplug
October 11th, 2011, 09:41 AM
InterlockedExchange64 is atomic on all architectures.

Use InterlockedExchange to exchange a 32bit variable.
Use InterlockedExchange64 to exchange a 64bit variable.

gg

superbonzo
October 12th, 2011, 02:42 AM
thank you ! :)