Arc Cross Reference

thread

[procedure] thread thunk

[procedure] kill-thread thread

[procedure] break-thread thread

[procedure] dead thread

Thread control primitives. In arc0, these are just imported from the underlying MzScheme's scheme:thread, scheme:kill-thread, scheme:break-thread, scheme:thread-dead?.

See also scheme:SRFI-18 for more common thread primitives in Scheme.

thread creates a new thread and executes thunk in a it. Returns a created thread descriptor. In SRFI-18 terms, it's the same as the following:

(thread-start! (make-thread thunk))

(Ref. scheme:thread-start!, scheme:make-thread)

kill-thread terminates the specified thread. (MzScheme allows to suspend the thread instead of kill, but the feature is not exposed in arc0. In SRFI-18 terms, it's scheme:thread-kill!.

break-thread causes the specified thread to raise break exception. It's MzScheme specific.

dead returns true/false whether the thread is running or terminated. (In arc0 there's a bug that Scheme's #t/#f is returned instead of t/nil).

See also atomic-invoke.