Boost logo

Boost :

From: Michael D. Crawford (crawford_at_[hidden])
Date: 2001-08-21 20:54:22


> 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.

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