A readers/writer lock regulates access to a set of data. The readers/writer lock is so called because many threads can hold the lock simultaneously for reading, but only one thread can hold the lock for writing.
Most device drivers do not use readers/writer locks. These locks are slower than mutexes. The locks provide a performance gain only when they protect commonly read data that is not frequently written. In this case, contention for a mutex could become a bottleneck, so using a readers/writer lock might be more efficient. The readers/writer functions are summarized in the following table. See the rwlock(9F) man page for detailed information. The readers/writer lock functions are:
Destroys a readers/writer lock
Downgrades a readers/writer lock holder from writer to reader
Acquires a readers/writer lock
Releases a readers/writer lock
Initializes a readers/writer lock
Determines whether a readers/writer lock is held for read or write
Attempts to acquire a readers/writer lock without waiting
Attempts to upgrade readers/writer lock holder from reader to writer