Re: Named shared memory without synchronization

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



"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


.



Relevant Pages

  • Re: non load/store architecture?
    ... Programmers can write great code on a RISC ... Especially in a PC marketplace dominated by the x86. ... Lots of registers and an orthogonal instruction set are important - both have these. ... The lack of registers means much more memory IO, which causes stalls and requires complex scheduling. ...
    (comp.arch.embedded)
  • Re: [PATCH] x86 - Enhance DEBUG_RODATA support - alternatives
    ... has been pulled out of the x86 tree. ... text_poke required to support this. ... correctly and so the CPU HOTPLUG special case can be removed. ... When you use this code to patch more than one byte of an instruction ...
    (Linux-Kernel)
  • Re: Free FORTH implementations?
    ... There is some older information by Phillip Koopman on instruction usage: ... The addresses are what a FORTH interpreter uses to call ... x86 16-bit code can be similarly sized or smaller because there are ... one with an average instruction size of two or less and the other ...
    (comp.lang.forth)
  • Re: thought: "Mini-x86"...
    ... You will try to execute int 0x80. ... This will fail at load time, the int instruction is not permitted. ... NaCl uses x86 fault mechanisms and segmentation ... This make NaCl only useful on x86. ...
    (comp.lang.asm.x86)
  • Re: atomic increment and fetch on intel ia32
    ... Is "inc mem" some kind of assembly instruction on x86? ... What do you mean by a lock prefix? ... Anyway, x86 inc can increment a register or a memory location, and can ...
    (comp.programming.threads)