Delay mystery solved
Kevin Fisher
kgf at golden.net
Thu Oct 26 16:51:15 UTC 2000
Yikes! Found out why Delay was failing for me....I was accidentally creating
*two* processes for my IO loop (done in a stupid piece of legacy code I forgot
to remove... *smacks forehead*). So, the delay object was getting scheduled
twice....creating a REAL mess. I'm surprised things worked at all! I'm
wondering if this was the cause of my bizarre slowdowns.
A question about processes and IO however...I'm still suspicious that I've got
some hidden processes piling up that are not getting garbage collected when I
end my program. I've structured things in an MVC-style manner...I've got a
main driving class that instantiates a class that draws the GUI, and also
instantiates a driver I wrote that forks a process off to read the serial port.
When the GUI is deleted (via the halo menu), I've overridden the delete method
to call the driving class, to instruct it to shut down the serial driver
(which terminates the polling process). After that....I'm assuming that
garbage collection will take care of the rest. Am I mistaken in this
assumption?
Also--is there a way to produce a 'list' of running processes, by chance? I
examined Process and didn't see anything obvious. In my brief
experimentations with Smalltalk/X years ago I remember there being a process
list of some kind.
(PS--sorry about the glut of questions from me today... Soon I will have a
finished product--a driver for reading X10 wireless remote controls that I
will publish to the list. Imagine, being able to flip the pages of a
BookMorph with a wireless remote...or control MP3 players, Squeak native or
otherwise! I've been having far too much fun with this stuff.... :)
More information about the Squeak-dev
mailing list
|