Synchronization overview
One main benefit of using threads is the ease of using synchronization facilities.
To effectively interact, threads must synchronize their activities.
This includes:
- Implicit communication through the modification of shared data
- Explicit communication by informing each other of events that have occurred
More complex synchronization objects can be built using the primitive objects.
The threads library provides the following synchronization mechanisms:Although primitive, these powerful mechanisms can be used to build more complex mechanisms.
The threads library provides the following synchronization mechanisms:
- Mutexes (See Using Mutexes)
- Condition variables (See Using Condition Variables )
- Read-write locks (See Using Read-Write Locks)
- Joins (See Joining Threads)