Lockless algorithms for mere mortals
Lockless algorithms for mere mortals
Posted Aug 1, 2020 12:47 UTC (Sat) by itsmycpu (guest, #139639)In reply to: Lockless algorithms for mere mortals by itsmycpu
Parent article: Lockless algorithms for mere mortals
In 2.3, it describes an atomic_thread_fence with acquire:
> The atomic_thread_fence() function can be used to order multiple sets of accesses, for example, by replacing a series of acquire loads with relaxed loads followed by an atomic_thread_fence(memory_order_acquire)
In its shortness, this sentence suggests the sequence:
1: A series of relaxed loads
2: An acquire fence
However reading https://en.cppreference.com/w/cpp/atomic/atomic_thread_fence suggests:
1: Reading a single synchronization variable (probably atomic relaxed, as in the example)
2: An acquire fence
3: A series of relaxed or non-atomic loads.
If you don't mind me pointing it out. Probably more like a typo.
Posted Aug 2, 2020 16:43 UTC (Sun)
by PaulMcKenney (✭ supporter ✭, #9624)
[Link]
I have therefore expanded this section to make step 3 explicit. Thank you for pointing this out.
There will be a P2055R1 at some point, but in the meantime you can access the LaTeX at https://github.com/paulmckrcu/WG21-relaxedguide.git.
Lockless algorithms for mere mortals