I understand them, but perhaps not well enough to coherently explain them.
-
-
Replying to @ManishEarth
And that's one of the problems! There are very few places these things are coherently explained! Even for C!
1 reply 0 retweets 0 likes -
Replying to @ManishEarth
There are a bunch of aspects involved here, not all of which he covered.
1 reply 0 retweets 0 likes -
Replying to @ManishEarth
Firstly, atomic ops and fences are often not explained in the same context.
1 reply 0 retweets 0 likes -
Replying to @ManishEarth
Then, it's not actually very clear what the nonatomic concerns are
1 reply 0 retweets 0 likes -
Replying to @ManishEarth
Are we only concerned about torn writes? Compiler-driven reorderings? CPU driven reorderings?
1 reply 0 retweets 0 likes -
Replying to @ManishEarth
Also x86 actually eliminates classes of these which only further muddies the waters
1 reply 0 retweets 1 like -
Replying to @ManishEarth
I think I've understood the pedagogical *problem* here but not enough to have a solution.
2 replies 0 retweets 0 likes -
Replying to @ManishEarth
@shipilev has some great material on the (fairly similar) Java Memory Model. Perhaps this helps.2 replies 0 retweets 0 likes -
Jeff Preshing's blog has the best explanation of atomics and fences: http://preshing.com/archives/
1 reply 0 retweets 3 likes
Atomics prevent torn writes. Fences and atomics with stronger-than-Relaxed orderings also prevent some compiler and CPU driven reorderings.
-
This Tweet is unavailable.
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.