[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-smalltalk] Issue with process.st and preemptive mode
From: |
Paolo Bonzini |
Subject: |
Re: [Help-smalltalk] Issue with process.st and preemptive mode |
Date: |
Mon, 17 May 2010 08:10:24 +0200 |
> One stupid question, when will terminated processes be
> removed/destroyed/deleted from the system? I have seen
> Process>>primTerminate (or such) but this does not seem to remove the
> Process?
A suspended process is removed from the process list. A terminated
process is simply a suspended process with a nil suspendedContext (so
it cannot be resumed).
The processes are destroyed/deleted through normal GC. Running
processes are never GCed, because they're accessible via Processor
which is one of the VM's roots. But non-running processes can be
garbage collected even before they've been terminated if:
1) they are suspended
2) they are waiting on a semaphore that is GCed itself.
as long as the process is not reachable otherwise. In both cases
#ensure: blocks etc. won't be executed, which makes suspending
processes usually a very bad idea unless you want to manage your
memory as you would in C. :-)
Paolo