Boost logo

Boost :

From: Talbot, George (Gtalbot_at_[hidden])
Date: 2006-11-10 10:20:42


My mistake.

So that seems like a bit of a useless guarantee--basically any structure
constructed with shared_ptr can only be read by the same thread that's
writing to the structure unless all of the pointer operations are
guarded with a mutex or spinlock, right?

Ignoring compare-and-swap, have you or anyone else experimented with
using a spinlock (as you mentioned previously) to remove the above
restriction? What would that do to performance and complexity? Could
you use a compare-and-swap type of operation to implement read/write
thread safety?

--
George T. Talbot
<gtalbot_at_[hidden]>
> -----Original Message-----
> From: boost-bounces_at_[hidden]
[mailto:boost-bounces_at_[hidden]]
> On Behalf Of Peter Dimov
> Sent: Friday, November 10, 2006 10:16 AM
> To: boost_at_[hidden]
> Subject: Re: [boost] boost::shared_ptr<>::compare_and_swap()--
> AmIinsaneforwanting this?
> 
> Talbot, George wrote:
> 
> > I'm sorry if I'm being too dense here.  I think a section in the
> > documentation saying exactly what is guaranteed and what isn't would
> > help a lot.
> 
> Here you go:
> 
> http://boost.org/libs/smart_ptr/shared_ptr.htm#ThreadSafety
> 
> _______________________________________________
> Unsubscribe & other changes:
> http://lists.boost.org/mailman/listinfo.cgi/boost

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