The reader-writer problem coordinates concurrent access to shared data: one writer may modify it exclusively, while multiple readers may read it together when no writer is active. section 16.2.2
In C++, shared mutexes express the two access modes:
- Use unique_lock with shared_mutex for writing; it excludes every other reader and writer. section 16.2.2
- Use shared_lock with shared_mutex for reading; multiple readers may hold the lock together, but writers cannot enter. section 16.2.2
Technicians and loggers
A shared meter is updated by three technician threads and observed by three logger threads. A technician locks it exclusively while setting its value; otherwise, several loggers can read and log the current setting simultaneously. section 16.2.2


