Re: How to do atomic read?
- From: "Alexander Grigoriev" <alegr@xxxxxxxxxxxxx>
- Date: Wed, 20 Jun 2007 06:11:22 -0700
<0dbell@xxxxxxxxx> wrote in message
news:1182342432.384995.41330@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
But, in case I am not seeing the obvious, what's wrong with:
LONG asignee = InterlockedExchange(&var, var);
First, it's NOT atomic. There is a window for change. This IS atomic:
LONG asignee = InterlockedCompareExchange(&var, 0, 0);
.
- Follow-Ups:
- Re: How to do atomic read?
- From: 0dbell
- Re: How to do atomic read?
- References:
- How to do atomic read?
- From: vasanth
- Re: How to do atomic read?
- From: 0dbell
- How to do atomic read?
- Prev by Date: Re: Creating virtual midi loopback driver
- Next by Date: Re: Regarding 64 bit machine
- Previous by thread: Re: How to do atomic read?
- Next by thread: Re: How to do atomic read?
- Index(es):
Loading