[Q] Process termination / GC

Anthony Hannan ajh18 at cornell.edu
Tue Jul 29 14:59:55 UTC 2003


Like I said before.  A suspended process or a waiting process whose
semaphore is free to be GCed will get GCed.  The problem Lex probably
saw was that a semaphore held by a socket will not get GCed until the
socket is destroyed.  This is because on socket initialize, its
semaphores are added to the external semaphore table in the special
object array.

To see free semaphores and its waiting processes get GCed, try the
following experiment.

1. Open the process browser.
2. Do "Semaphore new inspect".
3. Execute "5 timesRepeat: [[self wait] fork]" inside the inspector.
4. Update the process browser list.
5. You will see the 5 new waiting processes.
6. Close the inspector.
7. Update the process browser list.
8. You will see the 5 processes gone (GCed).  If not do "Smalltalk
garbageCollect" then update the list again.

Cheers,
Anthony



More information about the Squeak-dev mailing list