From: Peter Olcott on
What happens when two processes access memory at literally
the same time, with one reading and another writing, does
the read or the write get mangled? I know the whole
semaphore lock stuff, I want to know what happens when one
skips this step.


From: Sjouke Burry on
Peter Olcott wrote:
> What happens when two processes access memory at literally
> the same time, with one reading and another writing, does
> the read or the write get mangled? I know the whole
> semaphore lock stuff, I want to know what happens when one
> skips this step.
>
>
Skip that step and you have a pile of junk instead of a computer.
From: Peter Olcott on

"Sjouke Burry" <burrynulnulfour(a)ppllaanneett.nnll> wrote in
message news:4bbbabc4$0$14122$703f8584(a)textnews.kpn.nl...
> Peter Olcott wrote:
>> What happens when two processes access memory at
>> literally the same time, with one reading and another
>> writing, does the read or the write get mangled? I know
>> the whole semaphore lock stuff, I want to know what
>> happens when one skips this step.
> Skip that step and you have a pile of junk instead of a
> computer.

I am taking this informal message to mean:
On and given hardware platform, a simultaneous read
operation interferes with a write operation such that the
write operation is garbled.


From: Peter Olcott on

"Peter Olcott" <NoSpam(a)OCR4Screen.com> wrote in message
news:zuWdncZMA8wIJibWnZ2dnUVZ_rCdnZ2d(a)giganews.com...
>
> "Sjouke Burry" <burrynulnulfour(a)ppllaanneett.nnll> wrote
> in message
> news:4bbbabc4$0$14122$703f8584(a)textnews.kpn.nl...
>> Peter Olcott wrote:
>>> What happens when two processes access memory at
>>> literally the same time, with one reading and another
>>> writing, does the read or the write get mangled? I know
>>> the whole semaphore lock stuff, I want to know what
>>> happens when one skips this step.
>> Skip that step and you have a pile of junk instead of a
>> computer.
>
> I am taking this informal message to mean:
> On ANY given hardware platform, a simultaneous read
> operation interferes with a write operation such that the
> write operation is garbled.
>


From: Paul on
Peter Olcott wrote:
> "Peter Olcott" <NoSpam(a)OCR4Screen.com> wrote in message
> news:zuWdncZMA8wIJibWnZ2dnUVZ_rCdnZ2d(a)giganews.com...
>> "Sjouke Burry" <burrynulnulfour(a)ppllaanneett.nnll> wrote
>> in message
>> news:4bbbabc4$0$14122$703f8584(a)textnews.kpn.nl...
>>> Peter Olcott wrote:
>>>> What happens when two processes access memory at
>>>> literally the same time, with one reading and another
>>>> writing, does the read or the write get mangled? I know
>>>> the whole semaphore lock stuff, I want to know what
>>>> happens when one skips this step.
>>> Skip that step and you have a pile of junk instead of a
>>> computer.
>> I am taking this informal message to mean:
>> On ANY given hardware platform, a simultaneous read
>> operation interferes with a write operation such that the
>> write operation is garbled.
>>

The read or the write will not be mangled. Operations are
atomic enough, to complete, and all you have to worry
about from a programming perspective, is whether the
order they complete in matters or not.

If a read-modify-write instruction is involved, that is
atomic enough to complete, without being snipped in half.
The benefit of using an actual RMW type instruction on the
computer, is the processor takes care of it being atomic.
The processor won't allow an RMW to be split in half.

http://en.wikipedia.org/wiki/Read-modify-write

Paul