[Top][All Lists]

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

Re: The order of objects returned from a guardian

From: Kevin Ryde
Subject: Re: The order of objects returned from a guardian
Date: Tue, 02 Aug 2005 09:53:05 +1000
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/21.4 (gnu/linux)

Marius Vollmer <address@hidden> writes:
>      There is no guarantee about the order in which objects are returned
>      from a guardian.  If you want to impose an order on finalization
>      actions, for example, you can do that by keeping objects alive in
>      some global data structure until they are no longer needed for
>      finalizing other objects.

Perhaps an example here, it's hard to tell what you mean otherwise.

>      Being an element in a weak vector, a key in a hash table with weak
>      keys, or a value in a hash table with weak value does not prevent
>      an object from being returned by a guardian.  But as long as an
>      object can be returned from a guardian will it not be removed from
>      such a weak vector or hash table.  In other words, a weak link
>      does not prevent an object from being considered collectable, but
>      being inside a guardian prevents a weak link from being broken.
>      A key in a weak key hash table can be though of as having a strong
>      reference to its associated value as long as the key is accessible.
>      Consequently, when the key only accessible from within a guardian,
>      the reference from the key to the value is also considered to be
>      coming from within a guardian.  Thus, if there is no other
>      reference to the value, it is eligible to be returned from a
>      guardian.

Some rewording would make this clearer.

reply via email to

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