|
Boost : |
From: Lance.Diduck_at_[hidden]
Date: 2008-04-21 11:27:16
>is the code available somewhere? i had some trouble, implementing a
lock- free boost-style shared_ptr class and > started to write a smart
pointer with a different api
It is not open sourced. I can make it available, but unfortunatley my
laptop died this morning, so it may be a week or so until I am up and
running again from home.
I wrote up an entire description of how this works, but that is also on
the dead computer. Basically the idea is that the pointer and the object
both contain a version. If the versions do not match on the add_ref or
release, nothing happens, and the pointer fails its operation, and tries
again with fresh values.
The pointee must use a special allocator, that only allocates objects
that participate in this scheme (since it watnt to do bitwise compares
on memory that may be reclaimed, and these fields must always be in the
same place). This is not a big deal for a general shared_ptr, but my
version so far just uses intrusive_ptr (since in my apps I would
normally have used the intrusive_ptr anyway)
So please give me a while to get back up and running. Laptop is at the
shop now.
Lance
-----Original Message-----
From: boost-bounces_at_[hidden]
[mailto:boost-bounces_at_[hidden]] On Behalf Of Tim Blechmann
Sent: Monday, April 21, 2008 11:07 AM
To: boost_at_[hidden]
Subject: Re: [boost] Nonlocking data structures.
>> afaict, boost's smart pointer classes are not thread-safe
> They are not. I have a version that is, as long as you don't care
> about weak pointers. It still needs a lot of work however. The
> interesting thing about a ref counted lock-free smart ptr is that it
> is possible to easily make any program lock free. Not that it will be
> more efficient than a lock based one, but for small objects it works
great.
is the code available somewhere? i had some trouble, implementing a
lock- free boost-style shared_ptr class and started to write a smart
pointer with a different api ...
cheers, tim
-- tim_at_[hidden] http://tim.klingt.org I had nothing to offer anybody except my own confusion Jack Kerouac _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost Visit our website at http://www.ubs.com This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mails are not encrypted and cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of e-mail transmission. If verification is required please request a hard-copy version. This message is provided for informational purposes and should not be construed as a solicitation or offer to buy or sell any securities or related financial instruments.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk