Simple question about Processes

Ned Konz ned at bike-nomad.com
Wed Nov 15 05:23:09 UTC 2000


Kevin Fisher wrote:
> 
> This is probably a silly question but...  is there a proper way to make a
> sub-process terminate itself correctly?  For example, I've got a loop running
> in a seperate process..how do I signal that this process is done from within
> the process?

Just fall off the end, break out of the loop, ... When the block that
you forked ends, so does the process.

> So far I've tried sending 'terminate' to the process object representing the
> sub-process from -within- the sub-process, but this seems to leave behind an
> UndefinedObject>>DoIt in the Process List browser.  Am I missing something
> obvious?

Well, there's no reason to use terminate from within a process
(and, in fact, it might not necessarily work well). Just fall off
the end of the block, and make sure that there isn't another pointer
to the process itself (so it'll get garbage collected).

i.e.:

	[ 100 timesRepeat: [ 123 printString ] ] fork

will not leave any trace behind after a garbage collect, as long
as you don't keep any references to it.

-- 
Ned Konz
currently: Stanwood, WA
email:     ned at bike-nomad.com
homepage:  http://bike-nomad.com





More information about the Squeak-dev mailing list