Process Scheduling in Operating System
What is Process scheduling in Operating System
The decision to move different parallel processes competing with one another for execution, to different states like Ready to running or running to exit state based on a certain decision strategy is known as Process Scheduling in Operating System.
Handled by – Process Manager
Why CPU Scheduling?
One or more processes may be in the running state at the same time and they all share the CPU time using multiplexing.
Focus for Intelligent Scheduling is to –
- Keep CPU busy as much as possible if processes are waiting for execution
- Decrease the time of execution of critical processes
- Intelligently prioritise processes for execution
- Keep the response time minimum.
Types of Process Scheduling
We divided Process Scheduling into following two
- Preemptive Scheduling –The scheduling in which a running process can be interrupted if a high priority process enters the queue and is allocated to the CPU is called preemptive scheduling. In this case, the current process switches from the running queue to ready queue and the high priority process utilizes the CPU cycle.
- Non Preemptive Scheduling – The scheduling in which a running process cannot be interrupted by any other process is called non-preemptive scheduling. Any other process which enters the queue has to wait until the current process finishes its CPU cycle
Meaning of Prempt – take action in order to prevent (an anticipated event) happening; forestall.
Process Scheduling Queues
There are the following types of queues –
- Job Queue – Whenever any process enters the system its there in job Queue
- Ready Queue – Processes in the ready queue waiting for run time are in the ready queue.
- Device Queue – Some processes may be waiting some I/O operation, such processes are in the device queue.
Different Types of Schedulers
There are three type of schedulers categorically –
- Long-term Scheduler
- Short-term Scheduler
- Medium-term Scheduler
Long Term Scheduler
Also knowns as Job Scheduler. It selects the process that are to be placed in ready queue. The long term scheduler basically decides the priority in which processes must be placed in main memory. Processes of long term scheduler are placed in the ready state because in this state the process is ready to execute waiting for calls of execution from CPU which takes time that’s why this is known as long term scheduler.
Medium-Term Scheduler
It places the blocked and suspended processes in the secondary memory of a computer system. The task of moving from main memory to secondary memory is called swapping out. The task of moving back a swapped out process from secondary memory to main memory is known as swapping in. The swapping of processes is performed to ensure the best utilisation of main memory.
Short-Term Scheduler
Also knowns as CPU Scheduler. It decides the priority in which processes is in the ready queue are allocated the central processing unit (CPU) time for their execution. The short term scheduler is also referred as central processing unit (CPU) scheduler.
Context Switch
A context switch is a procedure that a computer’s CPU (central processing unit) follows to change from one task (or process) to another while ensuring that the tasks do not conflict. Effective context switching is critical if a computer is to provide user-friendly multitasking.
Prime Course Trailer
Related Banners
Get PrepInsta Prime & get Access to all 200+ courses offered by PrepInsta in One Subscription
Get over 200+ course One Subscription
Courses like AI/ML, Cloud Computing, Ethical Hacking, C, C++, Java, Python, DSA (All Languages), Competitive Coding (All Languages), TCS, Infosys, Wipro, Amazon, DBMS, SQL and others
Login/Signup to comment