Threads or suggestion?

Lex Spoon lex at cc.gatech.edu
Mon Aug 12 13:29:47 UTC 2002


Jason Dufair <jase at dufair.org> wrote:
> Indeed I am already using StreamingMP3Player, which subclasses from 
> SoundPlayer.  I have no trouble getting my sound to play in a different 
> process.  I needed a process/thread to monitor this sound playing 
> process and determine when it is done so I can automatically move to the 
> next song.  Fork is now doing the trick quite nicely.  Many thanks to 
> Bob Hartwig's SqueakAmp for examples to look at.  If I hadn't managed to 
> just corrupt my image, I'd have a nicely working model of my player all 
> set to go.  Now I'm fishing thru changes files.  Urg.
> 

Well, fork-based solutions mean you have to do inter-thread communication
at some point.  That communication can easily get tricky, so I try to avoid it.
I have also had to look at a number of Squeak images that have haywire background
threads, and a number of Squeak projects that mostly work but then pop up
debugger windows at seemingly random times.  Neither of these happen
with a sequential solution such as polling from #step.


-Lex



More information about the Squeak-dev mailing list