Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2008-01-18 13:34:11

Jeffrey Yasskin:

> Porting lock-free data structures from Java is complicated by the fact
> that the implementations assume garbage collection. There are a few
> techniques available for dealing with manual memory management without
> locks, but they complicate the implementation of algorithms that are
> complex enough already. So I'm thinking about trying to implement an
> atomic_shared_ptr<T> along the lines of the interface for other
> atomics defined in
> but
> using shared_ptr<T> as a value type. The implementation I'm thinking
> of uses hazard pointers
> ( and double-wide-cas
> (cmpxchg16b on x86-64). So I have three questions for this list:
> 1) Would there be interest in adding such a type to the Boost smart
> pointers?

I (and many others) will be very, very interested in your implementation,
doubly so if you implement it using the interface proposed in

I can't guarantee that your implementation will make it into Boost since
hazard pointers are rumored to be patent-encumbered.

> 2) Has someone already done this?

If you google :-) for Joe Seigh's atomic_ptr, you'll find his
implementation. It doesn't implement the entire shared_ptr interface though,
so your implementation will be unique in this regard.

Boost list run by bdawes at, gregod at, cpdaniel at, john at