[gclist] weak pointers

Colvin, Greg Greg@imr.imrgold.com
Wed, 26 Mar 97 10:14:30

Fabio asked weeks ago about the use of STL with distributed object stores.
Sorry to be so long answering.  

The ISO C++ committee is specifying an allocator interface for the STL that 
should allow you to make the standard containers gc-aware.  Basically, you 
can provide an allocator argument to the container templates that provides 
allocate and deallocate functions and appropriate pointer types.  The 
original STL required the pointer types to be raw, though possibly extended, 
pointers (e.g. T*, T __far*). For some implementations the pointer types can 
be "smart pointers" (e.g. gc_pointer<T>, weak_pointer<T>), but we are still 
debating whether to require this for all implementations.


______________________________ Reply Separator _________________________________
Subject: [gclist] weak pointers
Author:  gclist@iecc.com at Internet-Mail
Date:    2/12/97 7:04 AM

Received: by ccmail
Received:  from csn by imrgold.com (UUPC/extended 1.11) with UUCP;
           Wed, 12 Feb 1997 07:03:29 MST
Received: from ivan.iecc.com (root@ivan.iecc.com []) by 
uucp-1.csn. net (8.7.5/8.7.3) with SMTP id DAA14032 for <Greg@imr.imrgold.com>; 
Wed, 12 Feb 1 997 03:59:35 -0700 (MST)
Received: by ivan.iecc.com (Smail3.1.29.1 #15)
    id m0vubyc-000I2da; Wed, 12 Feb 97 05:31 EST
Sender: majordom@iecc.com (MajorDomo) 
Date: Wed, 12 Feb 1997 11:23:46 +0100
Message-Id: <199702121023.LAA24584@calvin.inria.fr> 
From: Fabio Riccardi <Fabio.Riccardi@inria.fr> 
X-ccAdmin: postmaster@csn
To: gclist@iecc.com
Subject: [gclist] weak pointers
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain; charset=iso-8859-1 
Precedence: bulk
Reply-To: gclist@iecc.com
Errors-to: owner-gclist@iecc.com
I have a question for the gc list...
in my research group we are implementing a distributed persistent 
object store (PerDiS: http://www-sor.inria.fr/perdis/).
Our store implements a notion of "persistence by reachability": an 
object is considered to be persistent in the store if it is reachable 
through a chain of pointers starting from some known root.
As all you might guess, this is the job of a garbage collector...
Now comes the question:
in our system we export towards the user an API with a basic C++ 
semantics: the user can allocate objects (with the new operstor) and 
navigate the store dereferencing pointers. The system will take care 
of removing useless garbage.
It would be nice though to give the user some kind of higher level 
facilities in the form of a library, like the STL, to manipulate 
indexed collections of objects, iterate on them, etc... like many 
OODBs do.
My problem is that such kind of library interferes with the work of 
the garbage collector, because the creation of indexes implies more 
references within the system, and such.
In the group we have come to the conclusion that we must use some kind 
of "weak pointers" to implement such facilities, or at least make our 
containers and indexes gc-aware.
Can any of you suggest some readings about this subject, or point to 
some related work, give advice, smart tricks?
Thank you very much in advance, ciao,
Fabio Riccardi - INRIA, Project SOR  |
email : Fabio.Riccardi@inria.fr      | * time is on our side! * 
phone : +33 (1) 39 63 57 55          |