mirror of
https://github.com/isocpp/CppCoreGuidelines.git
synced 2024-03-22 13:30:58 +08:00
commit
c333f52067
|
@ -8051,7 +8051,7 @@ Speaking of concurrency, should there be a note about the dangers of std::atomic
|
|||
A lot of people, myself included, like to experiment with std::memory_order, but it is perhaps best to keep a close watch on those things in production code.
|
||||
Even vendors mess this up: Microsoft had to fix their `shared_ptr`
|
||||
(weak refcount decrement wasn't synchronized-with the destructor, if I recall correctly, although it was only a problem on ARM, not Intel)
|
||||
and everyone (gcc, clang, Microsoft, and intel) had to fix their c`ompare_exchange_*` this year,
|
||||
and everyone (gcc, clang, Microsoft, and intel) had to fix their `compare_exchange_*` this year,
|
||||
after an implementation bug caused losses to some finance company and they were kind enough to let the community know.
|
||||
|
||||
It should definitely mention that `volatile` does not provide atomicity, does not synchronize between threads, and does not prevent instruction reordering (neither compiler nor hardware), and simply has nothing to do with concurrency.
|
||||
|
|
Loading…
Reference in New Issue
Block a user