Thank you Peter for the great comments!

On 2019-10-23 8:34 PM, Peter Relson wrote:
<snip>
The code snippets I posted show that the code sleeps rather than waiting
to be signaled which I suspect may be cheaper on those platforms.
</snip>
I don't know about the relative cheapness, but generally sleeping (and
looking again when you wake up) is easier, and waiting/posting
(pausing/releasing) is more responsive.

I've mostly seen user-space spin-locks in Linux (maybe should be called busy-wait loops) for use-cases like lock per bucket list in a hash table. Maybe using a kernel lock is more expensive in this case because the lock should be short lived and when contention does occur a context switch would be more expensive then spinning WRT latency. The locks generally back-off into hardware instruction pauses and/or timer waits.

It's probably a case of "horses for courses"! z/OS is optimized for batch/transactions workloads where an OS like Linux runs on many different devices. We would all be pretty miffed if streaming Netflix from our phones lagged because it's being frequently preempted :)


<snip>
This is quite common in the assembler code I see. A CS loop with a timer
</snip>
I presume you mean a CS loop that continues to loop even if the starting
condition does not change, but after a while sleeps.

<snip>
Is "priority inversion" not an issue on z/OS. I know that swapped out
address spaces go to the top of the dispatcher queue but
how does it work for tasks?
</snip>
Of course it's an issue. In some cases, the operating system can help. In
others, the (authorized) application must do it. I say "authorized"
because priority inversions in z/OS are typically multi-address-space
issues, because the default for tasks in an address space is that they all
run at the same priority.

<snip>
You can call CHAP.
</snip>
You can call it but it won't in general do anything to help a priority
inversion case, unless it's to help a problem that you introduced by
previous use of CHAP. CHAP is for creating your own intra-address space
priorities.

Peter Relson
z/OS Core Technology Design


----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to