OS161 Synchronization Primitives: RWLock

The idea of Reader-Writer Lock is quite simple. In normal lock, we don't differentiate the threads. That said, each thread who wants to enter the critical section must first acquire the lock. But on a second thought, you may find that threads actually have different behavior inside the critical section: some threads just want to see the values of shared variable, while others really want to update those variables.

more ...