Re: Named shared memory without synchronization
- From: "Igor Tandetnik" <itandetnik@xxxxxxxx>
- Date: Tue, 28 Nov 2006 08:15:54 -0500
"Dan Schwartz" <DanSchwartz@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:7D376D9F-0350-4404-B7C5-8880C8D6528A@xxxxxxxxxxxxx
"Igor Tandetnik" wrote:
Why not write a test and examine the generated assembly? In any case,
without LOCK prefix DEC instruction is _not_ atomic even on 32-bit
x86, which presents an obvious problem without even having to go
into arcane write reordering considerations.
"Simple reads and writes to properly-aligned 32-bit variables are
atomic.
DEC instruction performs a read followed by a write. Each half by itself
is atomic, but the combination is not. Memory could be modified by
another processor between a read and a write, and this new value will be
lost.
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925
.
- Prev by Date: Re: Creating member vars on the heap, not the stack
- Next by Date: Re: Remove debug macro function at release version?
- Previous by thread: Creating member vars on the heap, not the stack
- Next by thread: Re: Named shared memory without synchronization
- Index(es):
Relevant Pages
|