propagating QoS and priorities, what does that mean (1/...)
It's propagated by only 2 mechanisms (and anything built atop of it), and one secondary obsolete subsystem.
mechanism 2: XPC based IPC
the obsolete mechanism is manual pthread overrides, I will (almost) not cover them.
THAT'S IT
- the current QoS of the initiator thread,
- how you formed your dispatch_block() if using dispatch_block_create()
- the various QoS and labels of the queue you async/IPC to.
</ the end for QoS>
QoS will feed into the very complex scheme that gives you a priority but is only one aspect.
macOS/iOS is a complex layer of tons of different priorities, leaving to chance is a bad idea.
So what you need for priority inversion to kick in, is a wait primitive that has ownership information, IO primitives that record ownership
- pthread mutexes and os unfair locks (and things built on top)
- dispatch_sync() (but for reasons not onto the main queue, but that doesn't matter for apps)
- xpc_connection_send_with_message_sync() (with several caveats that don't fit on Twitter)
...
now back to the original question:
- a semaphore is not an "async" operation, so QoS is _not_ related to it. in any way.
- when you call *_semaphore_wait() the OS has no idea who will call the matching *_semaphore_signal() and hence has no ownership info.
that ends with the answer to the question you meant to ask "does groups have priority inversion avoidance" and the answer is "no because it has no ownership"
Unlike priority inversion avoidance that works through multi-hop chains through _very_ cool technology (look for turnstiles in XNU)...
Oh one last thing, I forgot, it's obvious to me but not readers, dispatch_once() is built on top of os_unfair_lock and admits an owner, and is priority inversion safe.
</end>