June 2017
Beginner to intermediate
274 pages
6h 49m
English
The condition objects combine some of the features of lock and event objects. Like a lock, they have acquire and release methods that can be used to protect data from simultaneous access.
However, a condition object also has a wait method and a notify method, which can be used to wait until some other process does something and to wake up a waiting process as shown in the following code example:

Condition objects are useful for creating data structures that synchronize access to their contents and wait when they don't have any data to return. The get and put methods of the queue class could be implemented using a condition ...
Read now
Unlock full access