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
thread::spawn(move || {let r1 = y.load(Ordering::Relaxed);// A
x.store(r1,Ordering::Relaxed);// B});
thread::spawn(move || {let r2 = x.load(Ordering::Relaxed);// C
y.store(42,Ordering::Relaxed);// D});
How should the compiler be able to move B in front of A, if r1 is not existing at this time?
I guess you meant that D can run before C, what makes perfect sense, because D has no connection to C that is visible for the compiler.
I am quite new to understanding this stuff, so happy if you correct me :)
The text was updated successfully, but these errors were encountered:
In the section about Relaxed Memory Ordering in the docs it is stated, that B can run before A.
loom/src/lib.rs
Line 294 in 31dfebd
How should the compiler be able to move B in front of A, if r1 is not existing at this time?
I guess you meant that D can run before C, what makes perfect sense, because D has no connection to C that is visible for the compiler.
I am quite new to understanding this stuff, so happy if you correct me :)
The text was updated successfully, but these errors were encountered: