[M3devel] Proposed Atomic Word.T interfaces.
hendrik at topoi.pooq.com
hendrik at topoi.pooq.com
Sun Dec 20 04:53:17 CET 2009
On Sat, Dec 19, 2009 at 06:30:47PM -0500, Tony Hosking wrote:
> Here is my updated proposal for Modula-3 Atomic Word.T.
> These are based on what we can have implemented from libatomic_ops, a prototype implementation for the C++ memory model standardization process. At the moment they are not gcc intrinsics, but I expect to see that coming as the standard progresses.
>
> INTERFACE Atomic;
>
> IMPORT Word;
>
> TYPE T = Word.T;
>
> TYPE
> Order = { Relaxed, Release, Acquire, AcquireRelease, Sequential };
> (* "Relaxed": The operation does not order memory.
>
> "Release": Performs a release operation on the affected memory locations,
> thus making regular memory writes visible to other threads through the
> variable to which it is applied.
>
> "Acquire": Performs an acquire operation on the affected memory
> locations, thus making regular memory writes in other threads released
> through the atomic variable to which it is applied, visible to the
> current thread.
It's not quite clear to me what these Orders mean. In particular,
I don't see a clear model for the interaction of 'visibility', 'memory
writes' and 'threads'. I can certainly find a ways to understand these
words, but I can't be sure I understand them the same way as they
are intended.
Perhaps I lack context that is provided somewhere.
-- hendrik
More information about the M3devel
mailing list