Scheduling (computing): Difference between revisions

Content deleted Content added
No edit summary
Tags: Reverted Visual edit Mobile edit Mobile web edit
Reverting edit(s) by 2605:8D80:543:7787:CC63:2ECD:4C30:34F6 (talk) to rev. 1224261498 by Guy Harris: Vandalism (UV 0.1.5)
Line 111:
 
===={{Anchor|SHORT-TERM}}Short-term scheduling====
The ''short-term scheduler'' (also known as the ''CPU scheduler'') decides which of the ready, in-memory processes is to be executed (allocated a CPU) after a clock [[interrupt]], an I/O interrupt, an operating [[System Called Cleverbot|system call]] or another form of [[Signal programming|signal]]. Thus the short-term scheduler makes scheduling decisions much more frequently than the long-term or mid-term schedulers{{snd}} A scheduling decision will at a minimum have to be made after every time slice, and these are very short. This scheduler can be [[Preemption (computing)|preemptive]], implying that it is capable of forcibly removing processes from a CPU when it decides to allocate that CPU to another process, or non-preemptive (also known as ''voluntary'' or ''co-operative''), in which case the scheduler is unable to ''force'' processes off the CPU.
 
A preemptive scqhedulerscheduler relies upon a [[programmable interval timer]] which invokes an [[interrupt handler]] that runs in [[kernel mode]] and implements the scheduling function.
 
===={{Anchor|DISPATCH-LATENCY}}Dispatcher====
Another component that is involved in the CPU-scheduling function is the dispatcher, which is the module that gives control of the CPU to the process selected by the short-term scheduler. It receives control in kernel mode as the result of an interrupt or system call. The functions of a dispatcher involve the following:
 
* [[Context switch]]es, in which the dispatcher saves the [[State (computer science)|state]] (also known as [[Context (computing)|context]]) of [[the]] [[Process (computing)|process]] or [[Thread (computing)|thread]] that was previously running; the dispatcher then loads the initial or previously saved state of the new process.
* Switching to user mode.
* Jumping to the proper ___location in the user program to restart that program indicated by its new state.