Skip to content

Latest commit

 

History

History
27 lines (19 loc) · 675 Bytes

README.md

File metadata and controls

27 lines (19 loc) · 675 Bytes

fetch_add vs. compare_exchange

Benchmark C++ standard atomic operations fetch_add and compare_exchange.

Two types of bencmarks:

  • refcount - aggressive concurrent usage of shared_ptr, implemented with:
    • std::atomic::compare_exchange_weak()
    • std::atomic::compare_exchange_strong()
    • std::atomic_fetch_sub()
    • with compare to std::shared_ptr
  • spinlock - aggressive concurrent usage of spinlock, implemented with:
    • std::atomic::compare_exchange_weak()
    • std::atomic::compare_exchange_strong()
    • std::atomic_fetch_add()
    • with compare to std::mutex

Build:
$ make

Run benchmark:
$ make bench

Show results:
$ make draw