11 Feb
2005
11 Feb
'05
12:19 p.m.
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.