43.3 Reader-Writer Locks

A reader-writer lock is a special type of mutex (see Section 43.2, Mutexes) used for resources that do not change very frequently. Any number of readers can acquire a read lock. However, when a write lock is acquired, no readers can access the data for the duration of the write lock.

Because of their implementation costs, reader-writer locks should not be preferred over mutexes without profiling the following:

LibC supports reader-writer locks on pthread, UI, and NKS interfaces. For a list of the functions, see Reader-Writer Lock Interface Comparison.