www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Usage of core.atomic (C++11/C11 Memory Model)

reply rm <rymrg memail.com> writes:
Hi,

I'm looking for algorithms and usage of core.atomic in real world 
programs. Any programming language should be fine as long as they make 
use of the C++11/C11 Memory Model[0].

Thanks in advance!

[0] A non exhaustive list of PL: C, C++, D, Rust.
[1] https://dlang.org/phobos/core_atomic.html
[2] https://llvm.org/docs/Atomics.html
[3] http://en.cppreference.com/w/cpp/atomic/memory_order
Nov 19 2020
parent reply Max Haughton <maxhaton gmail.com> writes:
On Thursday, 19 November 2020 at 08:42:32 UTC, rm wrote:
 Hi,

 I'm looking for algorithms and usage of core.atomic in real 
 world programs. Any programming language should be fine as long 
 as they make use of the C++11/C11 Memory Model[0].

 Thanks in advance!

 [0] A non exhaustive list of PL: C, C++, D, Rust.
 [1] https://dlang.org/phobos/core_atomic.html
 [2] https://llvm.org/docs/Atomics.html
 [3] http://en.cppreference.com/w/cpp/atomic/memory_order
Watch herb sutter's talks on atomics ("Atomic weapons" is the 3 hour version that goes into more depth)
Nov 19 2020
parent rm <rymrg memail.com> writes:
On 19/11/2020 17:54, Max Haughton wrote:
 On Thursday, 19 November 2020 at 08:42:32 UTC, rm wrote:
 Hi,

 I'm looking for algorithms and usage of core.atomic in real world 
 programs. Any programming language should be fine as long as they make 
 use of the C++11/C11 Memory Model[0].

 Thanks in advance!

 [0] A non exhaustive list of PL: C, C++, D, Rust.
 [1] https://dlang.org/phobos/core_atomic.html
 [2] https://llvm.org/docs/Atomics.html
 [3] http://en.cppreference.com/w/cpp/atomic/memory_order
Watch herb sutter's talks on atomics ("Atomic weapons" is the 3 hour version that goes into more depth)
Hi, Thank you for your reply. It took me long enough to watch the talk. The talk is mostly correct. The major complaint I have is that you cannot think about weak memory behaviors in terms of instructions re-ordering. A counter example for this is called IRIW (independent reads of independent writes). Where two threads see writes from other two threads in different order. I work on verifying the usage of these atomics hence looking for real usage to verify. Thanks again,
Dec 07 2020