[cpp-threads] Proposing a layered Thread API

Martin Sebor sebor at roguewave.com
Thu Sep 7 17:03:49 BST 2006


Kevlin Henney wrote:
> Lawrence Crowl <lawrence.crowl at gmail.com> writes
[...]
>> The expense is in the atomic increment and decrement operations.  In
>> particular, non-atomic operations are just a few cycles acting on the
>> cache closest to the processor.  The atomic operations need to coordinate
>> with other processors, and this can run to a hundred cycles.
> 
> 
> If there are no copies there is no cost associated with copying.

The cost may not be avoidable even in the single object case.
The reference count needs to be read in order to determine
whether there is any sharing or not, and the read needs to
be atomic.

Martin



More information about the cpp-threads mailing list