From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id OAA07644 for caml-redistribution; Wed, 19 Mar 1997 14:18:19 +0100 (MET) Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id IAA29823 for ; Wed, 19 Mar 1997 08:45:24 +0100 (MET) Received: from hplb.hpl.hp.com (hplb.hpl.hp.com [15.255.59.2]) by concorde.inria.fr (8.7.6/8.7.3) with ESMTP id IAA02051 for ; Wed, 19 Mar 1997 08:45:22 +0100 (MET) Received: from betze.bbn.hp.com by hplb.hpl.hp.com; Wed, 19 Mar 1997 07:45:18 GMT Received: from localhost (localhost [127.0.0.1]) by betze.bbn.hp.com with SMTP (8.7.1/8.7.1) id IAA07706 for ; Wed, 19 Mar 1997 08:45:16 +0100 (MET) Message-Id: <199703190745.IAA07706@betze.bbn.hp.com> X-Authentication-Warning: betze.bbn.hp.com: Host localhost [127.0.0.1] didn't use HELO protocol X-Mailer: exmh version 1.6.4 10/10/95 To: caml-list@pauillac.inria.fr Subject: Weak pointers (summarize) In-Reply-To: kohlerm's message of Tue, 18 Mar 1997 17:08:56 +0000. <199703181708.SAA27847@betze.bbn.hp.com> X-Face: 7'_lwZ-\~X.Q]-O#D;ju@c|HTi9[>\U8jV5(8sQpm)twOCgN.y]9s:L}A1_]h}_LHF@U5!2 5~FJ"9)`@~BEg9d;ftlb:bj9N>RTv0[VvZe7EMMB:$9hUc]&d9VN? Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 19 Mar 1997 07:45:16 +0000 From: Kohler Markus Sender: weis I would like to summarize our discussion about weak pointers. 1. There are some rare cases were weak pointers are usefull to implement shared datastructures efficiently. This is probably even more important for distributed data structures where message sending can be expensive. It works on your example, because it doesn't matter if the weak pointer points to valid data or not. 2. One have to be very carefully when using weak pointers. One example is extending our tree datastructure by an hash based access method. this would not work anymore with the weak pointer structure. 3. There are other perhaps more clean solutions for that problem : Since we know that every problem can be solved by an additional level of indirection, the following solution would be possible. | | | Proxy Hashtable | |_____A All pointers to nde a in the tree woudl have to point to a Proxy object, instead of pointing directly to object A. When all pointers to the Proxy object are gone it would go away and send a finalize message to A. A would then inform all it dependent objects "hey i'm going to be finalized". The dependent objects could then do the appropriate actions. 4. It would be really nice if pointers would be objects too. The solution in 3 could the be implemented transparently. Any comments ? Markus -- +----------------------------------------------------------------------------+ | Markus Kohler Hewlett-Packard GmbH | | Software Engineer Network & System Management Division| | IT/E Success Team | +----------------------------------------------------------------------------+