Boost logo

Boost :

From: Scott McCaskill (scott_at_[hidden])
Date: 2001-08-22 01:21:59


Thanks for the tip. It looks like ZooLib has ref_counting_ (rather than
_counted_) pointers, i.e. intrusive reference counting. FWIW, I've
developed what I consider to be an optimal or near optimal intrusive
reference counting scheme in C++, where I define 'optimal' to be 'difficult
or preferably impossible to circumvent the reference counting mechanism but
with minimal requirements of classes derived from the reference-counted base
class'. For example, I would prefer that nothing outside of the smart
pointer class be able to change the reference count of a reference-counted
object, and I would even like for it to be impossible to ever get a raw
pointer to a reference-counted object.

Anyway, since I think I have a solid understanding of intrusive reference
counting, I'm now in the process of learning as much as I can about
non-intrusive techniques (e.g. boost::shared_ptr). The policy-based pointer
stuff that Ross posted also looks interesting, although I shudder at the
thought of trying to get MSVC to grok it :)

----- Original Message -----
From: "Michael D. Crawford" <crawford_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Tuesday, August 21, 2001 8:54 PM
Subject: Re: [boost] thread-safe reference count

> > Agreed. I have a need for this, so I'm looking forward to it. For now
I
> > have copied and modified shared_ptr so I have a shared_ptr with a thread
> > safe reference count.
>
> I'd like to encourage you to check out the ZRefCount.h and ZAtomic.{h,cpp}
files
> in the ZooLib cross-platform application framework.
>
> Refcounted smart pointers are a very difficult subject and ZooLib author
Andy
> Green has worked hard to get them to work right.
>
> The code currently works on Mac OS, Windows, BeOS x86, and Linux for x86
and I
> think PowerPC. If you can write a little assembly or sufficient
primitives
> exist for another platform it's not too hard to make them work. Real Soon
Now
> I'm going to make it work on Sparc.
>
> http://zoolib.sourceforge.net/
>
> the sources themselves are at:
>
>
http://sourceforge.net/project/showfiles.php?group_id=5156&release_id=15636
>
> you will want to download both the zoolib and the zoolib-demos package to
be
> able to build ZooLib; it's probably worth building one of the ZooLib demos
to
> study ZRef in its native environment, but the code is self contained
enough that
> you shouldn't have to drag in much of ZooLib's other sources to use them.
>
> ZooLib is open source under the MIT License.
>
> Mike
> --
> Michael D. Crawford
> GoingWare Inc. - Expert Software Development and Consulting
> http://www.goingware.com
> crawford_at_[hidden]
>
> Tilting at Windmills for a Better Tomorrow.
>
> Info: http://www.boost.org Unsubscribe:
<mailto:boost-unsubscribe_at_[hidden]>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>


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