[Top][All Lists]

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

Re: Making guardians a module?

From: Marius Vollmer
Subject: Re: Making guardians a module?
Date: 06 Dec 2000 23:43:34 +0100
User-agent: Gnus/5.0803 (Gnus v5.8.3) Emacs/20.7

Dirk Herrmann <address@hidden> writes:

> On Wed, 6 Dec 2000, Dirk Herrmann wrote:
> > With respect to guardians one should know, that guardians are not a very
> > well thought out thing at all (IMO).  The interface is nice, but the
> > semantics are quite strange.  Assume for example, that every port that is
> > created is placed into a guardian, to allow for a close operation if the
> > file object gets lost.  Further, assume that the user puts a pair
> > consisting of a string and a port into a guardian, with the intention to
> > print out the string to the port as soon as the pair gets lost.  Now
> > assume that the pair actually gets lost and with it the port.  Then, the
> > pair can be fetched from the pair's guardian, and the port object can be
> > fetched from the guardian that stores all ports on creation.  
> > Unfortunately, there is no protection agains the case that the port is
> > fetched first by some code, that then performs finalization (i. e. closes
> > the port) and only later the pair is fetched from the other guardian.  
> > The attempt to print out the pair's string on the port will fail, because
> > the port is already closed.
> To see this effect, here is an example program:

I think we should fix this.  References from objects that are about to
be returned from a guardian should not be considered dead, the
referenced objects should be marked.

In your example, the port would not be returned by the port-guardian
as long as the cell is in the cell-guardian.

Is this possible?

reply via email to

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