Lightweight co-operative threads
Factor documentation > Factor handbook > The language
Prev:Combinators
Next:Lexical variables


Factor supports lightweight co-operative threads implemented on top of Continuations. A thread will yield while waiting for input/output operations to complete, or when a yield has been explicitly requested.

Factor threads are very lightweight. Each thread can take as little as 900 bytes of memory. This library has been tested running hundreds of thousands of simple threads.

Words for working with threads are in the threads vocabulary.
Starting and stopping threads
Yielding and suspending threads
Thread-local state and variables
Thread implementation