Http://www.cnblogs.com/maxupeng/archive/2011/07/21/2112282.html
One, mutex (mutex)
The mutex is essentially a lock that locks the mutex before accessing the shared resource, releasing the lock on the mutex after the access is complete.
When the mutex is locked, any other thread that attempts to lock the mutex again will be blocked until the current thread releases the mutex. If multiple threads are blocked when a mutex is released, all blocked threads in the mutex become operational, the first thread that becomes running can lock the mutex, and the other threads will see the mutex locked and can only go back and wait for it to become available again. In this case, only one thread can execute forward at a time.
Second, signal volume (semaphore)
Mutexes can only be used for mutually exclusive access to a resource, and it cannot implement multi-threaded mutex issues for multiple resources. The semaphore can realize multi-thread mutual exclusion and synchronization of multiple homogeneous resources. When the semaphore is a single-valued semaphore, it is also possible to complete a mutually exclusive access to a resource.
Third, read-write lock
Read and write locks are similar to mutexes, but read-write locks allow for higher parallelism. The mutex is either locked or unlocked, and only one thread can lock it at a time.
Iv. condition variables (condition) and monitors (monitor)
When used with a mutex, the condition variable allows the thread to wait for a particular condition to occur in a non-competitive manner.
C # Learning Notes---Thread synchronization: Mutex, semaphore, read-write lock, condition variable