Newsgroups: comp.lang.smalltalk
Path: cantaloupe.srv.cs.cmu.edu!rochester!udel!news.mathworks.com!newsfeed.internetmci.com!in2.uu.net!news.maz.net!ins.net!heeg.de!gustav!hmm
From: hmm@gustav (Hans-Martin Mosner)
Subject: Re: [VW] Process suspend -> gone? (why?)
Message-ID: <DKuwx1.Gq4@heeg.de>
Sender: uucp@heeg.de
Organization: Georg Heeg Objektorientierte Systeme, Dortmund, FRG
X-Newsreader: TIN [version 1.2 PL2]
References: <4cn9nv$3qr8@news-s01.ny.us.ibm.net>
Date: Mon, 8 Jan 1996 09:55:48 GMT
Lines: 29

johnmci@ibm.net wrote:
: I'm working on a system that has multiple processes. I've create a subclass of
: Process to track my Processes of interest. However occasionally I want to stop ALL 
: my processes and view what they are doing, and why. (Aren't dynamic systems fun?)

: Anyways when I suspend the processes they soon disappear (yes they get GC) 
: Why? All the books I have point to the fact you can resume them to continue.

You need to store the processes in some variable to keep them alive.
The system roots only reference processes that are runnable or waiting on
a delay or something, but processes that are suspended or terminated are
eligible for garbage collection.
So you should do the following:

MyProcesses := JmmProcess allInstances.
MyProcesses do: [:each | each suspend].
MyProcesses inspect.
...
MyProcesses do: [:each | each resume].

Hope this information helps.

	Hans-Martin

--
+--- Hans-Martin Mosner -------- Senior Smalltalk Guru ---+
| These opinions are entirely ficticious.  Any similarity |
| to real opinions is purely coincidental and unintended. |
+--- <hmm@heeg.de> ------ URL:http://www.heeg.de/~hmm/ ---+
