Nay. Many, many instructions are not atomic. On a single CPU, yes. For
multiple CPUs, not atomic. Until the z13 (?), for example, NI, OI and XI
were interruptible within a reference to a single byte. NI is actually
fetch, AND, store. It could be interrupted between the fetch and the store.
So two processors doing NI or OI on the same byte could get "logically
impossible" results.

Charles


-----Original Message-----
From: IBM Mainframe Assembler List [mailto:[email protected]]
On Behalf Of Phil Smith
Sent: Sunday, July 30, 2017 5:51 PM
To: [email protected]
Subject: Re: Question about CPUs

Charles Mills wrote, in part:
>The effect of multiple CPUs on a multi-task program is even worse than 
>the load, add, store example above. With two CPUs, it is possible for 
>even single machine instructions to interleave. So if one task executes 
>MVC FOO,=C'Now is the time for all good men to come to the aid of the 
>party' and another CPU executes MVC FOO,=C'The quick brown fox jumps over
the lazy dog'
>it is at least in theory* possible for FOO to end up containing 'Now is 
>the time fox jumps over the lazy dog the aid of the party'.

Mmm...I'm pretty sure a single instruction is still atomic. I'm sure Peter
Relson or one of the other IBMers will chime in, but it there has to be some
sort of interlock at some level. And I've debugged plenty of concurrency
problems, never seen a mixture from a single instruction!

...phsiii

Reply via email to