Thread (24 messages) flat view 24 messages, 4 authors, 2016-06-15

Re: [PATCH 1/5] MSVC: Windows-native implementation for subset of Pthreads API

From: Peter Harris <hidden>
Date: 2016-06-15 22:48:01

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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help