Skip to content

saai63/Lockfree_Reader_Writer

Repository files navigation

Lockfree_Reader_Writer

License: MIT

Build

Build

Requirements

  • 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.

Solutions

Global object and std::shared_ptr

Reader_Writer_pointer_globalObj.cpp

std::shared_ptr and temporary object

Reader_Writer_pointers_only.cpp

Test results

  • Both solutions seem to work
  • No issues pointed out by thread sanitizer

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published