Tuesday, December 06, 2016

Process Scheduling

Process Scheduling

The act of determining which process in the ready state should be moved to the running state is known as Process Scheduling.
The prime aim of the process scheduling system is to keep the CPU busy all the time and to deliver minimum response time for all programs. For achieving this, the scheduler must apply appropriate rules for swapping processes IN and OUT of CPU.

Process Scheduler

The process scheduler is the component of the operating system that is responsible for deciding whether the currently running process should continue running and, if not, which process should run next. There are four events that may occur where the scheduler needs to step in and make this decision:
  1. The current process goes from the running to the waiting state because it issues an I/O request or some operating system request that cannot be satisfied immediately.
  2. The current process terminates.
  3. A timer interrupt causes the scheduler to run and decide that a process has run for its allotted interval of time and it is time to move it from the running to the ready state.
  4. An I/O operation is complete for a process that requested it and the process now moves from the waiting to the ready state. The scheduler may then decide to preempt the currently-running process and move this newly-ready process into the running state.

Schedulers fell into one of the two general categories :
  • Non pre-emptive scheduling. A scheduler is a preemptive scheduler if it has the ability to get invoked by an interrupt and move a process out of a running state to let another process run.When the currently executing process gives up the CPU voluntarily.
  • Pre-emptive scheduling. If a scheduler cannot take the CPU away from a process then it is a cooperative, or non-preemptive scheduler. When the operating system decides to favour another process, pre-empting the currently executing process.

 

No comments:

Post a Comment