Showing posts with label Scheduling. Show all posts
Showing posts with label Scheduling. Show all posts

Wednesday, April 10, 2019

Describe Scheduler. Give different types of Scheduler.

Scheduler:

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:

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 SchedulerThe 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..







What is Process Scheduling? Describe different types of Scheduling Queues.

Process Scheduling:

Process scheduling is a strategy that is used when there are limited resources and many processes have to compete by using them. Multi programming tries to ensure that there is some process running at all times. This is due to utilize the CPU as much as possible. when system shares time, the CPU switches so frequently between jobs that the user not feel that the machine is being shared by many processes or even many users.
If the system has more than one processor. then it is possible, then it is possible to execute more than one processor at the same time. In a single processor system, only one processor can be executed at the given time. If there are more than more processes than processors, then the operating system must schedule the processes. It means that some processes will be executed and will have to wait. There are many queues for deciding which process should be assigned the CPU.
Scheduling Queues:

There are three types of queues.

  • Job Queue
  • Ready Queue 
  • Waiting Queue
Job Queue:

Jobs are submitted to a job queue. Each entering process goes into job queue. The processes in job queue reside on secondary storage and wait the allocation of main memory.

Ready Queue:

The set of all processes that are in main memory and are in waiting for CPU time are kept in ready queue.


Waiting Queue:

The set of processes waiting for all allocation of certain I/O devices, are kept in waiting queue.