arc> (thread (asv 8000)) #See MzScheme's Threads for details of the threading model.arc> ready to serve port 8000
thread [body ...]
Creates and returns a new thread, which will last until the body terminates.
|
>(thread (+ 1 2) (+ 3 4)) #<thread> >(type (thread (+ 1 2))) thread |
new-thread procedure
Creates and returns a new thread, which will last until
procedureterminates. This was called thread in arc0. |
>(new-thread (fn () (+ 1 2))) #<thread> |
break-thread thread
Triggers a break exception on a thread.
|
>(let th (thread (sleep 2)) (break-thread th)) user break |
kill-thread thread
Terminates the specified thread immediately.
|
>(let th (thread (sleep 100))
(kill-thread th)
(dead th))
t
|
sleep secs
Causes the current thread to sleep for at least the
specified time.
|
>(sleep 0.1) nil |
dead thread
Predicate to test if a thread has terminated.
|
>(let th (thread (sleep 1)) (prn (dead th)) (sleep 2) (prn (dead th))) nil t t |
Copyright 2008 Ken Shirriff.