|
Boost Users : |
From: Ben Hutchings (ben.hutchings_at_[hidden])
Date: 2005-02-11 07:19:00
Paul wrote:
>
>> Paul,
>>
>> When the flag has changed the memory semantics of your system maybe
>> such that your cpu doesn't see the change for quite a while without
>> memory barriers.
>>
>> If it changes, say flip flops between true and false (not relevant to
>> your case above), then you could end up with different values
>> everywhere at once which may be inconvenient to your programs
>> correctness.
>>
>
> good lord, assembler? doesn't the 'volatile' keyword fix the problem
> you describe?
<snip>
In practice it probably does, but you should be aware that the semantics
of "volatile" are platform-dependent and generally do not include the
generation of memory barriers. In particular pthreads does not assign
any synchronisation properties to it.
Ben.
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net