On Thu, Jan 14, 2010 at 12:12 AM, Dmitry Potapov wrote:
On Wed, Jan 13, 2010 at 07:40:43PM +0100, Johannes Sixt wrote:
quoted
Is there "InterlockedRead()"? I suppose no, but I would get confirmation that
a simple memory mov instruction is atomic WRT Interlocked* functions.
If I were writing Interlocked API, I would certainly add InterlockedRead()
and InterlockedWrite() functions, but somehow Microsoft decided that these
functions are redundant.
InterlockedWrite is spelt InterlockedExchange.
Finally, there is a paranoiac implementation of InterlockedRead(&foo):
result = InterlockedAdd(&foo, 0)
but, IMHO, it is pathetic...
Agreed. Another pathetic implementation:
result = InterlockedCompareExchange(&foo, 0, 0);
Peter Harris