| Date | Mon, 24 Feb 2014 08:40:50 -0800 | Subject | Re: [RFC][PATCH 0/5] arch: atomic rework | From | Linus Torvalds <> |
| |
On Mon, Feb 24, 2014 at 8:37 AM, Linus Torvalds <torvalds@linux-foundation.org> wrote: > > So yes, the atomic_read() would be ordered wrt '*ptr' (getting 'q') > _and_ '**ptr' (getting 'i'), but nothing else - including just the > aliasing access of dereferencing 'i' directly.
Btw, what CPU architects and memory ordering guys tend to do in documentation is give a number of "litmus test" pseudo-code sequences to show the effects and intent of the language.
I think giving those kinds of litmus tests for both "this is ordered" and "this is not ordered" cases like the above is would be a great clarification. Partly because the language is going to be somewhat legalistic and thus hard to wrap your mind around, and partly to really hit home the *intent* of the language, which I think is actually fairly clear to both compiler writers and to programmers.
Linus
|