Does lock-free boost::shared_ptr<T> implementation exist?

Hi, I'm trying to find a production quality lock free reference counted pointer implementation and boost::shared_ptr seems promising. However boost::atomic_is_lock_free(shared_ptr) returns false on Windows. I'm going to try on SUSE linux soon. According to http://www.boost.org/doc/libs/1_43_0/libs/smart_ptr/shared_ptr.htm, Starting with Boost release 1.33.0, shared_ptr uses a lock-free implementation on the following platforms: GNU GCC on x86 or x86-64; GNU GCC on IA64; Metrowerks CodeWarrior on PowerPC; GNU GCC on PowerPC; Windows. Then why does boost::atomic_is_lock_free(shared_ptr) returns false? Is there any compiler flag that needs to be set? I also found another lock free reference counted pointer, atomic_ptr from Joe Seigh here http://sourceforge.net/projects/atomic-ptr-plus/files/ but it seems to support linux with GCC only. Documentation is also poor. -Anqing

AMDG Anqing Xu wrote:
I'm trying to find a production quality lock free reference counted pointer implementation and boost::shared_ptr seems promising. However boost::atomic_is_lock_free(shared_ptr) returns false on Windows. I'm going to try on SUSE linux soon.
According to http://www.boost.org/doc/libs/1_43_0/libs/smart_ptr/shared_ptr.htm,
Starting with Boost release 1.33.0, shared_ptr uses a lock-free implementation on the following platforms:
GNU GCC on x86 or x86-64;
GNU GCC on IA64;
Metrowerks CodeWarrior on PowerPC;
GNU GCC on PowerPC;
Windows. Then why does boost::atomic_is_lock_free(shared_ptr) returns false?
atomic_is_lock_free indicates whether atomic operations on the shared_ptr object are lock-free. The reference count is lock free. In Christ, Steven Watanabe

I'm trying to find a production quality lock free reference counted pointer implementation and boost::shared_ptr seems promising. However boost::atomic_is_lock_free(shared_ptr) returns false on Windows. I'm going to try on SUSE linux soon.
while the reference counting itself is lock-free, boost::atomic<boost::shared_ptr> requires dcas support to be lockfree ... hth, tim -- tim@klingt.org http://tim.klingt.org I must say I find television very educational. The minute somebody turns it on, I go to the library and read a good book. Groucho Marx
participants (3)
-
Anqing Xu
-
Steven Watanabe
-
Tim Blechmann