|
Boost : |
From: Greg Colvin (gcolvin_at_[hidden])
Date: 1999-07-27 11:47:38
From: Kevlin Henney <Kevlin.Henney_at_[hidden]>
> Greg Colvin wrote:
> To change the topic slightly -- for shared_ptr I don't think we
> need a full threading library, we just need a way, on any given
> computer, to atomically decrement-and-test the counter variable.
> Given that, it doesn't matter how threads are done.
>
> Agreed. The last thing that shared_ptr needs is a heavy overhead locking
> mechanism; inc and dec&test need to be lock-free and atomic. Therefore,
> should the problem be removed one level by writing shared_ptr in terms of
> such a counter, and isolating the platform specific w/i that counter class
> alone?
>
> Kevlin
Probably. I recall that Dag once made a proposal for an atomic
integer, which I'll try to dig up.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk