And back, I was thinking about how to implement different synchronization primitives in terms of each other. For example, in pthreads you get mutexes and condition variables, and semaphores can be built from them.
In the Windows API (or at least in older versions of the Windows API) there are mutexes and semaphores, but there are no variable conditions. I think it should be possible to build variable conditions from mutexes and semaphores, but for my life I just can't figure out how to do this.
Does anyone know of a good design for this?
source
share