[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Swarms, zones, dropping, and resource management.
From: |
Albert-Jan Brouwer |
Subject: |
Swarms, zones, dropping, and resource management. |
Date: |
27 Apr 99 22:57:34 +0100 |
Resource management in Swarm is confusing me somewhat. From the documentation
I gather that a swarm functions as a container for objects such that upon
dropping the swarm, all objects allocated within it are dropped as well.
E.g., in the SimpleExperBug tutorial the following method is defined:
- dropModel
{
// The model has finished and we've extracted the data we need from
// it. We drop the modelSwarm's activity, and then drop the modelSwarm
// itself which drops of the objects built by modelSwarm
[[modelSwarm getActivity] drop];
[modelSwarm drop];
return self;
}
However when I override the drop method of one of the objects contained in
the model swarm like so;
- (void)drop
{
[super drop];
printf("Goodbye cruel world...\n");
}
no goodbyes are given, that is, it appears as if the the drop method of
the objects contained in the swarm being dropped is not called (under
swarm 1.3.1). What is going on here?, specifically:
- Is drop being called on an object when a containing swarm or zone is
dropped?
- Is the drop method intended to be overridden? I would have assumed
it to be the proper place to do clean up of resources not bound up
with a zone, e.g. closing a file opened with fopen() by the object
to be destoyed.
- If no drop is called, is the memory corresponding to the objects
cleaned up nevertheless?
- If the memory is cleaned up, is this done by dropping the zone
corresponding to the swarm within which all objects within the swarm
are supposed to have been allocated? Presumably this recurses to any
sub swarms / zones within a swarm?
- Is a new zone created whenever a new swarm is created or does a swarm
inherit the zone passed on as a parameter to the create/createBegin
method causing its instantiation?
Best regards,
Albert-Jan
---
Albert-Jan Brouwer, department of molecular physics, Leiden University.
EMail: address@hidden or address@hidden
==================================
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.
- Swarms, zones, dropping, and resource management.,
Albert-Jan Brouwer <=