swarm-support
[Top][All Lists]
Advanced

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

Re: Swarms, zones, dropping, and resource management.


From: Marcus G. Daniels
Subject: Re: Swarms, zones, dropping, and resource management.
Date: 27 Apr 1999 14:42:33 -0700

>>>>> "AB" == Albert-Jan Brouwer <address@hidden> writes:

AB> - Is drop being called on an object when a containing swarm or
AB> zone is dropped?

No.

AB> - Is the drop method intended to be overridden?

No, not really.  Parts of Swarm, especially the GUI, were written in
parallel with defobj (e.g. Zones) -- this code does explicit drops,
but won't do the right thing if its owner Zone were to be dropped.

AB> I would have
AB> assumed it to be the proper place to do clean up of resources not
AB> bound up with a zone, e.g. closing a file opened with fopen() by
AB> the object to be destoyed.

The mechanism that exists for Zone-oriented resource releases (e.g.
fopen), is the addRef:withArgument: interface.  This lets one set up
a function to be called when the deallocation is about to be done.
[There were some messages about this on the mailing list a few weeks ago --
you might check the archives for more info.]

AB> - If no drop is called, is the memory corresponding to the objects
AB> cleaned up nevertheless?

Yes.

AB> - If the memory is cleaned up, is this done by dropping the zone
AB> corresponding to the swarm within which all objects within the
AB> swarm are supposed to have been allocated? 

There's a data structure in a Zone that enumerates all objects
in it, including subzones.  There's also a data structure in each object
that enumerates all the notification references.  Dropping a Zone
results in iteration over these data structures.

AB> Presumably this
AB> recurses to any sub swarms / zones within a swarm?

Yes.

AB> - Is a new zone created whenever a new swarm is created or does a
AB> swarm inherit the zone passed on as a parameter to the
AB> create/createBegin method causing its instantiation?

When an object is allocated in a Swarm, i.e., the Swarm is used as
as an argument to +create:, that object is put in a new internal
Zone that's created when the Swarm is created.

                  ==================================
   Swarm-Support is for discussion of the technical details of the day
   to day usage of Swarm.  For list administration needs (esp.
   [un]subscribing), please send a message to <address@hidden>
   with "help" in the body of the message.



reply via email to

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