Weak pointers (summarize)

From: Kohler Markus (kohlerm@betze.bbn.hp.com)
Date: Wed Mar 19 1997 - 08:45:16 MET

Message-Id: <199703190745.IAA07706@betze.bbn.hp.com>
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.
Date: Wed, 19 Mar 1997 07:45:16 +0000
From: Kohler Markus <kohlerm@betze.bbn.hp.com>

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.

                | | |
        Hashtable |

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

4. It would be really nice if pointers would be objects too. The solution in 3
could the be implemented transparently.

Any comments ?


| Markus Kohler                          Hewlett-Packard GmbH                |
| Software Engineer                      Network & System Management Division| 
|                                        IT/E Success Team                   |

This archive was generated by hypermail 2b29 : Sun Jan 02 2000 - 11:58:09 MET