What is Scheduling ?
- Scheduling is an essential part of a Multiprogramming operating systems.
- Such operating systems allow more than one process to be loaded into the executable memory at a given time and the loaded process shares from the CPU using time multiplexing.
- The Operating System maintains the following important process scheduling queues −
- Job queue − This queue preserves all the processes in the system.
- Ready queue − This queue keeps a set of all processes residing in main memory, ready and waiting to execute. A new process is always placed in this queue.
- Device queues − The processes which are blocked due to inaccessibility of an I/O device establish this queue.
![Scheduling](https://cdn.wikitechy.com/interview-questions/operating-system/what-is-scheduling.jpg)
What is Scheduling
- The OS can use different procedures to manage each queue (FIFO, Round Robin, Priority, etc.).
- The OS scheduler determines how to move from processes between the ready and run queues which can only have one entry per processor core on the system; in the above diagram, it has been combined with the CPU.
Schedulers are of three types:
- Long-Term Scheduler
- Short-Term Scheduler
- Medium-Term Scheduler
Long Term Scheduler:
- It is also called a job scheduler.
- It selects processes from the queue and loads into memory for execution.
- The long-term scheduler may not be accessible or minimal.
- No long-term scheduler in the time-sharing operating systems.
- Use of long-term scheduler when a process changes the state from new to ready.
Short Term Scheduler:
- Short term scheduler is also known as CPU scheduler.
- It is used to improve system performance.
- It is change from ready state to running state of the process.
- Short term scheduler is faster than compared to long term scheduler.
Medium Term Scheduler:
- Medium-term scheduling is a part of swapping.
- Medium Term Scheduler has removed the processes from the memory.
- To remove the process from memory and make space to the other processes, the postponed process is moved to the secondary storage.
- This process is called swapping.