[cpp-threads] Web site updated
Peter Dimov
pdimov at mmltd.net
Fri Feb 16 03:36:32 GMT 2007
Paul E. McKenney wrote:
> The compiler's and the hardware's reordering is almost, but not quite,
> equivalent. The hardware is constrained so that a given CPU refrains
> from doing any reordering that would be visible to that CPU. In
> contrast, the compiler's reordering can be visible even within the
> confines of a single CPU, for example, via signal handlers (or,
> equivalently, interrupt handlers).
Maybe, but there is still need for a _relaxed atomic which does not prohibit
reorderings, and for a _release atomic which only prohibits reorderings in
the downward direction.
>>> This would prohibit implementations of reference counts or locks
>>> based on store_raw().
>>
>> I believe that reference counts do work when the increment is
>> _relaxed. Unlocking a mutex is a _release operation, so I'm not sure
>> how store_raw is relevant there. But I may be missing something.
>
> Interactions with signal/interrupt handlers.
Can you provide an example where refcounting using relaxed increments is
broken by an interrupt handler, but not broken if the increments are
"volatile relaxed" (reordered by hardware but not by compiler)?
More information about the cpp-threads
mailing list