5 questions to test your understanding
A parent thread must wait until a child thread finishes initialization before proceeding. Which approach is most appropriate?
A bounded buffer holds up to 5 items. You use a counting semaphore 'empty' (initialized to 5) and 'full' (initialized to 0). A producer wants to insert an item. What is the correct sequence?
A binary semaphore and a mutex are functionally identical because both restrict access to one thread at a time.
Calling signal (V) on a semaphore when no threads are blocked still increments the counter, effectively saving the signal as a credit for a future wait call.
Why is it correct to say semaphores 'generalize' mutexes rather than simply being a different kind of lock?