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

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

 



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:
>> 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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]