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
Copy file name to clipboardExpand all lines: book/en-us/07-thread.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -462,7 +462,7 @@ In order to achieve the ultimate performance and achieve consistency of various
462
462
463
463
3. Release/Acquire model: Under this model, we can further tighten the order of atomic operations between different threads, specifying the timing between releasing `std::memory_order_release` and getting `std::memory_order_acquire`. **All** write operations before the release operation are visible to any other thread, ie, happens-before.
464
464
465
-
As you can see, `std::memory_order_release` ensures that the write behavior after it does not occur before the release operation, is a backward barrier, and`std::memory_order_acquire` ensurestheprevious write behaviorafter it, no It will happenafterthe get operation,it is a forward barrier. For theoption`std::memory_order_acq_rel`, it combines the characteristics of the two, andonly determines a memory barrier, so that the current thread reads andwrites to thememory. Will not be rearranged before and after this operation.
465
+
As you can see, `std::memory_order_release` ensures that the write behavior after it does not occur before the release operation,whichis a backward barrier, and`std::memory_order_acquire` ensuresthat itsprevious write behaviordoes not occurafterthis acquisition operation,there is a forward barrier. For the `std::memory_order_acq_rel` option, it combines the characteristics of the two anduniquely determines a memory barrier, so that the current thread's reading andwriting ofmemory will not be rearranged before and after this operation.