[Q] Process termination / GC
tblanchard at mac.com
tblanchard at mac.com
Mon Jul 28 18:01:06 UTC 2003
I'm working on making top level Bricks handle events in their own
processes by allowing them to provide their own event dispatcher which
contains a SharedQueue and a process to poll it. So my dispatcher
initializer looks like:
queue := SharedQueue new.
process := ([ [true] whileTrue: [self dispatchEvent: (self queue next)
with: (self owner) ] ] fork).
The dispatcher is held in a WeakKeyDictionary keyed by the Brick so it
will go away on its own - and the owner Brick is held weakly as well.
The dispatcher is added as a listener to the hand and removed the first
time it gets an event outside the Brick's bounds. So as far as I can
tell, the only think keeping the dispatcher from being collected is its
Brick's existence.
Do I need to do anything to clean up the process? Or, more
importantly, is the forked block going to prevent GC on the dispatcher?
This is the first time I have played with Processes and I have no idea.
Todd Blanchard
More information about the Squeak-dev
mailing list
|