You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently memory_order_acquire and memory_order_release are considered unsafe:
The problem is critical sections overlap in the following situation with mutexes or other synch object:
auto _Level = _Wait_functions._Api_level.load(_STD memory_order_acquire);
The task is to confirm the situation with compiler team and decide on using memory_order_acquire / memory_order_release in mentioned and possibly unmentioned preexisting code and new code
Note also that memory model implementation on arm may change in the future, see #83 , see also ##488 , #775 , #1082
The text was updated successfully, but these errors were encountered:
I would also want to make sure that any use of acq/rel doesn't lead to Independent Reads, Independent Writes problems (which full sequential consistency solves; some algorithms are affected by IRIW).
Currently
memory_order_acquire
andmemory_order_release
are considered unsafe:The problem is critical sections overlap in the following situation with mutexes or other synch object:
Release reorders past subsequent unrelated acquire, so sections overlap and deadlock occurs.
The current resolution is believed to be the following:
Unfortunately, 1 is not what Standard currently says, and 2 and 3 has to be confirmed with compiler vendors
Before the status of acquire / release is clarified, currently seq_cst is used in some places, specifically:
atomic_shared_ptr
internal spinlock:STL/stl/inc/memory
Line 3130 in 12c684b
STL/stl/inc/memory
Line 3150 in 12c684b
STL/stl/inc/atomic
Lines 394 to 407 in 12c684b
<execution>
(more than just this occurrence):STL/stl/inc/execution
Line 3624 in 12c684b
memory_resource.cpp
STL/stl/src/memory_resource.cpp
Line 24 in 12c684b
STL/stl/src/memory_resource.cpp
Line 33 in 12c684b
STL/stl/src/memory_resource.cpp
Line 43 in 12c684b
STL/stl/src/memory_resource.cpp
Line 53 in 12c684b
filesystem.cpp
STL/stl/src/filesystem.cpp
Lines 36 to 50 in 12c684b
Some places believed to be not affected by the issue still use acquire / release, specifically:
shared_ptr
external spinlock:STL/stl/src/atomic.cpp
Lines 16 to 34 in 12c684b
<system_error>
STL/stl/inc/system_error
Lines 590 to 597 in 12c684b
atomic_wait.cpp
STL/stl/src/atomic_wait.cpp
Lines 147 to 152 in 12c684b
The task is to confirm the situation with compiler team and decide on using
memory_order_acquire
/memory_order_release
in mentioned and possibly unmentioned preexisting code and new codeNote also that memory model implementation on arm may change in the future, see #83 , see also ##488 , #775 , #1082
The text was updated successfully, but these errors were encountered: