Multiple Wait (Muxwait) Semaphores

A multiple wait (muxwait) semaphore enables a thread to wait on several event or mutex semaphores simultaneously. A muxwait semaphore is a compound semaphore that consists of a list of up to 64 event semaphores or mutex semaphores (the two types cannot be mixed).

A flag is set when the muxwait semaphore is created to enable threads to use the semaphore in either of two ways:

Depending on the value of the flag, a muxwait semaphore is said to have cleared when either any or all of the semaphores in the muxwait list have been posted or released.

For example, suppose a thread requires access to several regions of shared memory at the same time. OS/2 blocks the thread until the thread acquires ownership of all the mutex semaphores protecting the shared regions. The thread can then access all the memory regions. Meanwhile, OS/2 prevents access by other threads.


[Back: Mutual Exclusion (Mutex) Semaphores]
[Next: Named and Anonymous Semaphores]