Training
×

Event Driven Scheduling

A thread is only interesting for the thread scheduler when it can do something useful with the core, in other words when it is in the ready state. In some OSs a thread is always ready and can waste CPU time by polling for an event. Most multi-threading systems have the notion of an event: the thread waits in a suspended state for a hardware or software state change before executing. Examples are:
  • an interrupt generated by a hardware device when it needs attention
  • a message produced by a thread that needs to be processed by another thread (possibly for transmitting to a device)
  • a signal generated by a thread indicating some alarm condition
  • the passing of a certain time period