Factor Documentation
|
Home
|
Glossary
|
Search
factorcode.org
Yielding and suspending threads
Factor documentation
>
Factor handbook
>
The language
>
Co-operative threads
Prev:
Starting and stopping threads
Next:
Thread-local state and variables
Yielding to other threads:
yield
( -- )
Sleeping for a period of time:
sleep
( dt -- )
Interrupting sleep:
interrupt
( thread -- )
Threads can be suspended and woken up at some point in the future when a condition is satisfied:
suspend
( state -- obj )
resume
( thread -- )
resume-with
( obj thread -- )