[plt-scheme] threads and 352

From: Corey Sweeney (corey.sweeney at gmail.com)
Date: Wed Sep 20 14:34:56 EDT 2006

I've spent the last 3 days porting my applicatoins from 299.406 to 352.  I
think i'm down to one issue:

When I start drscheme, I do the following:

> (time (thread (lambda () (display "hi"))))
WARNING: The definitions window has changed. Click Run.
cpu time: 0hi real time: 1 gc time: 0

which seems reasonable.  However, after I run my application, threads start
taking a longer time.  like:

(time (thread (lambda () (display "hi"))))
hicpu time: 2008 real time: 2008 gc time: 1988

It gets progressively worse as I use my application.  Does anyone have any
idea what could be causing this?  I use thread on every mouse click to play
a "feedback sound" through esd (a sound player that will play the sound
without blocking all the sounds going on from other applications)

(thread (lambda ()
           (system (string-append "/usr/bin/esdplay /usr/share/sounds"
(symbol->string sound-file-name)))))

which i tried changed to:

(thread (lambda ()
           (process (string-append "/usr/bin/esdplay /usr/share/sounds"
(symbol->string sound-file-name))))))

and tried changing to:

(thread (lambda ()
             (let ((thing
                    (process (string-append "/usr/bin/esdplay
/usr/share/sounds" (symbol->string sound-file-name)))))

               [(fifth thing) `wait]
               [(fifth thing) `kill]
               (close-input-port (first thing))
               (close-output-port (second thing))
               (close-input-port (fourth thing))

I'm imagining that I'm accumulating something. At one point in time I got a
"too many open files" error. (which is why i started manually closing the

Does anyone have any idea what I could be accumulating from one run to the
next?  (i don't name the created thread, so i don't believe i have any
references to it)


((lambda (y) (y y)) (lambda (y) (y y)))
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20060920/be734b9e/attachment.html>

Posted on the users mailing list.