Quantcast
Channel: Different ways of implementing atomic *= - Stack Overflow
Browsing index pages (2 articles)
↧

Different ways of implementing atomic *=

Studying through a book, it explains how to implement more complex operations like operator* for std::atomic<T>. Implementation uses compare_exchange_weak and I think I understood how this works....

View Article


Answer by rmm19433 for Different ways of implementing atomic *=

Imagine between your call to load and compare_exchange_weak the value gets changed by another thread. expected has no longer the current value. compare_exchange_weak works as follows:Atomically...

View Article

Browsing index pages (2 articles)


Latest Images