Isn't there some issue with using SUSPEND or RESUME if the caller of the code 
in question might hold locks and you have no control over that (such as in a 
system exit)?

Charles


-----Original Message-----
From: IBM Mainframe Assembler List [mailto:[email protected]] On 
Behalf Of Ed Jaffe
Sent: Tuesday, December 19, 2017 10:30 AM
To: [email protected]
Subject: Re: LT Instruction After Compare And Swap

On 12/18/2017 6:02 PM, Tony Harminc wrote:
>
> I wouldn't want to have to argue the case for having an enabled 
> application program do spin loops. But we don't know the context this 
> code was found in; maybe it's part of an OS or a standalone program.

In my entire IT career, most of which has been spent developing system 
software, I have never once had to resort to a home-grown spin lock. 
Long, long ago I authored a FIFO "lock manager" based on the examples found in 
the Principals of Operation. It has served us well for decades. 
The same logic works whether the pool of locks is local storage or global 
storage. As long as both asynchronous units of work have some way of waiting 
and being posted (and that might be SUSPEND/RESUME for preemptible class SRBs), 
then a spin lock should *never* be required.

--
Phoenix Software International
Edward E. Jaffe
831 Parkview Drive North
El Segundo, CA 90245
http://www.phoenixsoftware.com/

Reply via email to