[plt-scheme] Idiom for suspending the top level thread

From: Noel Welsh (noelwelsh at yahoo.com)
Date: Tue Jun 13 06:54:04 EDT 2006

In Java, if the thread that starts a program stops, the JVM
will not exit if there are other threads running (modulo
some interactions with daemon threads I forget).

In MzScheme, if the thread that starts a program stops
MzScheme exits.  (Verified with a test program in 349.100;
couldn't find an discussion in the docs)

What is the preferred idiom for suspending the top level
thread to stop a program exiting?  I don't have access to
the other threads I've spawned.  Ideas include:

 (let loop () (loop))  ;; busy wait
 (thread-suspend (current-thread))
 (thread-wait (current-thread))

TIA,
Noel

Email: noelwelsh <at> yahoo <dot> com   noel <at> untyped <dot> com
AIM: noelhwelsh
Blogs: http://monospaced.blogspot.com/  http://www.untyped.com/untyping/

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


Posted on the users mailing list.