[cpp-threads] Proposing a layered Thread API

Kevlin Henney kevlin at curbralan.com
Thu Sep 7 16:14:50 BST 2006


Lawrence Crowl <lawrence.crowl at gmail.com> writes
>On 9/3/06, Kevlin Henney <kevlin at curbralan.com> wrote:
>> I also don't see why a reference count plus a copy will be expensive.
>> There is no significant space overhead to a reference count and no
>> additional allocations required and, unless someone is pathologically
>> making copies all over the place, there is little cost associated with
>> copying. Perhaps you could clarify where the reference count plus copy
>> overhead is.
>
>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. If 
there is some copying there is some cost. If there is pathological 
copying there is a great cost. What I was trying to determine was where 
the implied significant, extra costs were as I'm struggling to see them.

Kevlin
-- 
____________________________________________________________

   Kevlin Henney                   phone:  +44 117 942 2990
   mailto:kevlin at curbralan.com     mobile: +44 7801 073 508
   http://www.curbralan.com        fax:    +44 870 052 2289
   Curbralan: Consultancy + Training + Development + Review
____________________________________________________________




More information about the cpp-threads mailing list