- Provide read and write interfaces to an underlying data structure.
- Access should be thread safe.
- Reads will be frequent while writes will be rare.
- Multiple threads should be able to read data in parallel and should not be blocked by other readers.
- Writers modify the data and hence writes cannot be concurrent.
Reader_Writer_pointer_globalObj.cpp
Reader_Writer_pointers_only.cpp
- Both solutions seem to work
- No issues pointed out by thread sanitizer