[M3devel] readonly access to a BOOLEAN, unprotected?

Rodney M. Bates rodney_bates at lcwb.coop
Thu Feb 13 23:51:41 CET 2014


Rd.m3 contains, for example:

PROCEDURE Closed (rd: T): BOOLEAN =
   BEGIN
     RETURN (rd.closed);
   END Closed;

Most other procedures in Rd lock rd before doing anything.

Even though it's only read access, and to a BOOLEAN, is it really true that we can rely
on this to work on all targets with neither a lock nor some atomic operation?
It seems to me like it should be OK, but I have thought that several times before.
only to be shown wrong.  Meanwhile, modern hardware keeps adding more complex
caching, making these things trickier.






More information about the M3devel mailing list