A process is passed in different Scheduling queues throughout its lifetime. The operating system select the processes from these queues in a way for scheduling purpose. The part of the operating system related to this selection is called the scheduler.
Scheduler |
Scheduling Algorithm:
Scheduling algorithm is an algorithm which is to schedule the processes.
Three type of scheduling perform by the operating system:
- Long Term Scheduler
- Short Term Scheduler
- Medium Term Scheduler
Long Term Scheduler or job scheduler is used to select a job or user program from job queue to the ready queue in the main memory. The job becomes a process after it has been added to the ready memory. The long term scheduler controls the number of processes in memory also known as the degree of multi programming. The system may get slow if too many processes are loaded into the main memory.
Short Term Scheduler:
The short term scheduler takes a process from ready queue and allocates CPU to that process for execution. It is also called CPU Scheduler. The short term scheduler is invoked vert frequently and must very fast. A Process is typically allocated the CPU for a very short period of time. It is move backed to ready queue after the given time is over. It may be executed only for a milliseconds. The short term scheduler then points the next process to execute from the ready queue. Thus the short term scheduling decisions much more frequently than the long-term and mid-term schedulers,
Medium Term Scheduler:
The medium-term scheduler removes the processes temporarily from main memory and places them on secondary memory such as a disk drive. It moves it back to main memory when required. It is commonly known as swapping in and swapping out. The medium -term scheduler may decide to swap out a process which has not been active for some time it has a low priority. It can also swap auto process that is taking up a large amount of memory to free up main memory for other [processes. It swaps in the process in later when more memory is available or when the process is unblocked and is not waiting fir a resource. It improves the performance of the system by reducing the degree if multi programming..
No comments:
Post a Comment