Boost logo

Boost :

From: Larry Evans (cppljevans_at_[hidden])
Date: 2006-02-28 07:35:04


On 02/28/2006 01:09 AM, Yigong Liu wrote:
>
> Yes, most design considerations of message passing systems still apply, such
> as avoiding data copying (Channel did it by message reference counting).
> More suggestions and comments are highly appreciated.
>
Hi, Yigong.

I know almost nothing about distributed systems, but the above mention
of reference counting reminded me that "weighted reference counting"
is supposed to have some speed advantage in distributed systems.
A reference is [lins91c] as shown on:

   http://www.cs.kent.ac.uk/people/staff/rej/gcbib/gcbibL.html

IIRC, it saves time at the cost of memory. The extra memory is caused
by the "weight" of of the reference count being stored in the smart
pointer instead of a reference count in the object pointed-to. The
weight is, I think, log2 of the normal reference count. Each
time a copy is made, the weight is evenly divided between the from and
to smart pointers. Only when an object is destroyed is communication
with the pointee needed. Of course, there must be some provision for
the weight dropping below 1 when too many copies are made.

Would that be any use in your library?


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