October 2017
Intermediate to advanced
354 pages
9h 28m
English
Spinlock implementation discussed until now protects shared data by enforcing standard mutual exclusion between concurrent code paths racing for shared data access. This form of exclusion is not suitable for the protection of shared data which is often read by concurrent code paths, with infrequent writers or updates. Reader-writer locks enforce exclusion between reader and writer paths; this allows concurrent readers to share lock and a reader task will need to wait for the lock while a writer owns the lock. Rw-locks enforce standard exclusion between concurrent writers, which is desired.
Rw-locks are represented by struct rwlock_t declared in kernel header <linux/rwlock_types.h>:
typedef struct { arch_rwlock_t
Read now
Unlock full access