Boost logo

Boost :

Subject: [boost] Does lock-free boost::shared_ptr<T> implementation exist?
From: Anqing Xu (anqingxu_at_[hidden])
Date: 2010-07-12 11:55:05


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

                                               


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk