Low-Lock Singletons In D
deadalnix
deadalnix at gmail.com
Mon May 6 03:12:52 PDT 2013
On Monday, 6 May 2013 at 10:06:50 UTC, Mehrdad wrote:
> On Monday, 6 May 2013 at 09:35:59 UTC, Dmitry Olshansky wrote:
>> You have to read a field to know what to do next, and the
>> other processor may as well write to it.
>
>
> That never happens, though. _static is only written to inside a
> lock, and the check is inside a lock, hence the other processor
> can't be writing to it when it's being read...
>
>
> Maybe I misunderstood what you're saying?
ON x86 you rarely see this kind of thing as the memory model is
strong. You can see some weird thing in rare cases, but as soon
as you leave x86 world, it isn't even worth trying.
More information about the Digitalmars-d
mailing list