Re: How to do atomic read?
- From: 0dbell@xxxxxxxxx
- Date: Wed, 20 Jun 2007 13:49:01 -0000
On Jun 20, 9:11 am, "Alexander Grigoriev" <a...@xxxxxxxxxxxxx> wrote:
<0db...@xxxxxxxxx> wrote in message
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);
Thanks for the correction. Can you explain why?
And what's Second?
Regards,
Don
.
- Follow-Ups:
- Re: How to do atomic read?
- From: Alexander Grigoriev
- Re: How to do atomic read?
- From: Mark Roddy
- Re: How to do atomic read?
- References:
- How to do atomic read?
- From: vasanth
- Re: How to do atomic read?
- From: 0dbell
- Re: How to do atomic read?
- From: Alexander Grigoriev
- How to do atomic read?
- Prev by Date: Re: Regarding 64 bit machine
- Next by Date: Re: How to do atomic read?
- Previous by thread: Re: How to do atomic read?
- Next by thread: Re: How to do atomic read?
- Index(es):
Loading