On 2019-10-22 1:55 AM, Tony Harminc wrote:
On Sun, 20 Oct 2019 at 02:32, David Crayford <[email protected]> wrote:
The only code I've seen that implements yield are synchronization
routines. Consider a spin-lock which is spinning on a CS instruction.
Why would any application program on z/OS implement and use a spin
lock?
Define application program? COBOL batch or CICS transaction program?
Most legacy applications on z/OS don't implement concurrency.
Porting modern code is another matter. You may find a lot of the new
ported code like Node.js (V8), libuv etc implement their own locks.
Why do the authors of such think they can do a better
implementation than the operating system?
Maybe using SETLOCK (which requires supervisor state, key 0) is an
obstacle?
If you think you need a spin lock on z/OS, you should probably be
using transactional execution.
Yes, I agree. But it's quite tricky to grok and you need to crack open
the assembler!
There's an example of a lock-free queue using transactional execution in
Zowe
https://github.com/zowe/zowe-common-c/blob/719251839033059fb3b507f26f6fbb58be57f188/c/collections.c#L1123
Tony H.
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN