swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: address@hidden: address@hidden: [lists.hpcoders.com.au: Re: [Swarm-S


From: Russell Standish
Subject: Re: address@hidden: address@hidden: [lists.hpcoders.com.au: Re: [Swarm-Support] development priorities (was Re: Membership in Swarm Developmen Group)]]]
Date: Thu, 16 Nov 2006 02:01:30 +1100
User-agent: Mutt/1.4.2.1i

On Wed, Nov 15, 2006 at 05:12:41PM -0700, Marcus G. Daniels wrote:
> 
> P.S. I remember you once mentioning your smart pointer system in 
> EcoLab.  Is there a paper handy?  
> Maybe I'm an old-timer but I'm glad there are still C and C++ ABM 
> simulators out there!
> 

Smart pointers are pretty old hat. For example, the boost library has
several implementations, some of which will presumably make their way
into the standard library at some point.

If you were referring to object reflection (and serialisation), you
need to look at my Classdesc stuff (heavily used within EcoLab). See
arXiv:cs.CE/0610120 .

I have my own smart pointer implementation in EcoLab for two
reasons. One is that Boost is a 30+ MB download, so I've chosen to
avoid depending on Boost, and secondly Boost smart pointers require
you to initialise the smart pointer to whatever object you are
pointing to:

   boost::shared_ptr<T> p(new T);

which works fine, provided the pointer you use for initialisation has
been created by a new statement. Otherwise when shared_ptr comes to
destroy the object, all hell breaks loose.

In my ref<T> class, objects are created the first time the pointer is
dereferenced, so there is no possibility of subverting it in the above
way. Also, the reference counter is maintained in the same chunk of
memory as the object itself (unlike boost::shared_ptr) and without
programmer intervention (unlike boost::intrusive_ptr).

AFAIK, EcoLab is the only serious C++ ABM system. I've come across few
other C++ simulator projects, but none of them seemed to be
particularly mature or active.

As for C simulators, one can use C in EcoLab about as well as one can
use C in Swarm - doable in a pinch, but not really recommended.

-- 

----------------------------------------------------------------------------
A/Prof Russell Standish                  Phone 0425 253119 (mobile)
Mathematics                              
UNSW SYDNEY 2052                         address@hidden
Australia                                http://www.hpcoders.com.au
----------------------------------------------------------------------------


reply via email to

[Prev in Thread] Current Thread [Next in Thread]