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
> > 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}
> in the ZooLib cross-platform application framework.
> Refcounted smart pointers are a very difficult subject and ZooLib author
> 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
> exist for another platform it's not too hard to make them work. Real Soon
> I'm going to make it work on Sparc.
> the sources themselves are at:
> you will want to download both the zoolib and the zoolib-demos package to
> able to build ZooLib; it's probably worth building one of the ZooLib demos
> 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
> crawford_at_[hidden]
> Tilting at Windmills for a Better Tomorrow.
> Info: Unsubscribe:
> Your use of Yahoo! Groups is subject to

Boost list run by bdawes at, gregod at, cpdaniel at, john at