Semaphores for Ordering
This lesson discusses another use case of semaphores, as a way for ordering events in concurrent programs.
We'll cover the following...
Semaphores are also useful to order events in a concurrent program. For example, a thread may wish to wait for a list to become non-empty, so it can delete an element from it. In this pattern of usage, we often find one thread waiting for something to happen, and another thread making that something happen and then signaling that it has happened, thus waking the waiting thread. We are thus using the semaphore as ...
Access this course and 1400+ top-rated courses and projects.