Next: Load distribution
Up: Thread management
Previous: Spark
- Need to ensure that a thunk is evaluated only once, and no two
threads evaluates the same thunk simultaneously.
- This is achieved by requiring a thread entering a thunk to
overwrite the thunk with a black-hole . A thread entering a
black-hole saves its state in its TSO, attaches its TSO to the queue
of threads blocked on the black-hole and enters the scheduler.
- A thread completing the evaluation of a thunk overwrites it with
its value and moves its TSO to the runnable pool.
- Synchronisation costs only when two threads collide.
Ananda Amatya
2/16/1999