Medium-term scheduling controls the transition of paused flows to standby
and back. In the control unit which is ready for execution,
threads are
immediately organized in a structure called queue of ready threads ( or
ready queue ).
The transition to a suspended state can be caused by the following factors:
❖
Waiting for an I / O operation
❖
Waiting for the completion of another thread (joining)
❖
Blocking a stream because it needs to be synchronized with other
streams
Usually, for the correct organization of this expectation, in addition to the
queue
of ready threads, they implement an additional set of queues. Each
such queue is associated with a resource that may cause flow expectations
(eg, an I / O device); These queues are called scheduling queues or
waiting
for queues ( wait for queues ). The mid-term scheduler manages all these
queues by moving threads between them and the queue of ready threads.