Relative Content

Tag Archive for c++multithreadingatomicmemory-barriers

C++: std::shared_ptr and memory_order

I know that the typical recommended implementation of std::shared_ptr implies that the counter is incremented with the relaxed mode while the decrement operation needs the release mode (and, if it happens that it is the last reference, the acquire fence is followed by the deletion of a control block).
Consider the following code: