Module sleep

Source
Expand description

Code that decides when workers should go to sleep. See README.md for an overview.

ModulesΒ§

counters πŸ”’

StructsΒ§

IdleState πŸ”’
An instance of this struct is created when a thread becomes idle. It is consumed when the thread finds work, and passed by &mut reference for operations that preserve the idle state. (In other words, producing one of these structs is evidence the thread is idle.) It tracks state such as how long the thread has been idle.
Sleep πŸ”’
The Sleep struct is embedded into each registry. It governs the waking and sleeping of workers. It has callbacks that are invoked periodically at significant events, such as when workers are looping and looking for work, when latches are set, or when jobs are published, and it either blocks threads or wakes them in response to these events. See the [README.md] in this module for more details.
SleepData πŸ”’
WorkerSleepState πŸ”’
The β€œsleep state” for an individual worker.

ConstantsΒ§

ROUNDS_UNTIL_SLEEPING πŸ”’
ROUNDS_UNTIL_SLEEPY πŸ”’