search
Log In
Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
Welcome to GATE CSE Doubts, where you can ask questions and receive answers from other members of the community.
0 votes
16 views
How do we categorize a scheduling algorithm as CPU bound or I/O bound?
in Operating System 5 points 16 views

1 Answer

0 votes

@Jayantmukundam

1. Preemptive Scheduling:

Preemptive scheduling is used when a process switches from running state to ready state or from waiting state to ready state.

The resources (mainly CPU cycles) are allocated to the process for the limited amount of time and then is taken away, and the process is again placed back in the ready queue if that process still has CPU burst time remaining. That process stays in ready queue till it gets next chance to execute....

 

2. Non-Preemptive Scheduling:

Non-preemptive Scheduling is used when a process terminates, or a process switches from running to waiting state. In this scheduling, once the resources (CPU cycles) is allocated to a process, the process holds the CPU till it gets terminated or it reaches a waiting state….

In case of non-preemptive scheduling does not interrupt a process running CPU in middle of the execution. Instead, it waits till the process complete its CPU burst time and then it can allocate the CPU to another process....

 

Key Differences Between Preemptive and Non-Preemptive Scheduling:

1. In preemptive scheduling the CPU is allocated to the processes for the limited time whereas in Non-preemptive scheduling, the CPU is allocated to the process till it terminates or switches to waiting state.

2. The executing process in preemptive scheduling is interrupted in the middle of execution when higher priority one comes whereas, the executing process in non-preemptive scheduling is not interrupted in the middle of execution and wait till its execution.

3. In Preemptive Scheduling, there is the overhead of switching the process from ready state to running state, vise-verse, and maintaining the ready queue. Whereas in case of non-preemptive scheduling has no overhead of switching the process from running state to ready state.

4. In preemptive scheduling, if a high priority process frequently arrives in the ready queue then the process with low priority has to wait for a long, and it may have to starve. On the other hands, in the non-preemptive scheduling, if CPU is allocated to the process having larger burst time then the processes with small burst time may have to starve.

5. Preemptive scheduling attain flexible by allowing the critical processes to access CPU as they arrive into the ready queue, no matter what process is executing currently. Non-preemptive scheduling is called rigid as even if a critical process enters the ready queue the process running CPU is not disturbed.

6. The Preemptive Scheduling has to maintain the integrity of shared data that’s why it is cost associative as it which is not the case with Non-preemptive Scheduling…

 

1. https://gateoverflow.in/18743/scheduling-algorithm 

 

2. https://gateoverflow.in/262098/%23os-%23fcfs  

 

3. https://www.cs.uic.edu/~jbell/CourseNotes/OperatingSystems/5_CPU_Scheduling.html

633 points
0

@Jayantmukundam

It is very simple. If one is taking bath, one first checks, how much hot is hot water and then checks, how much cold is cold water. Then adjusts the tap knob to bring out a mix of cold water which will suit the skin. Just put this analogy to scheduler, scheduler being knob and skin being system architecture.

So in the same way, it is important for a scheduler to distinguish between I/O bound and CPU bound processes to give an optimal usage of system resources. Scheduler uses this information to schedule a decent mix of both I/O bound and CPU bound processes.

For example, a game, it contains human interaction and also much calculations are involved. So scheduler will increase priority of the I/O bound to give you maximum interactive experience.

Let us say all jobs are CPU bound, then I/O waiting queue will be almost empty and if all jobs are I/O bound, ready queue will be empty. There by a mix of CPU bound and I/O bound is necessary for optimal system utilization.

A CPU bound job will be raising I/O requests frequently also, and the processes doing I/O bound jobs will require CPU time as well. So, if scheduler knows what is what, it can optimally schedule them taking care of real time processes like human computer interaction etc.…

 

http://faculty.salina.k-state.edu/tim/ossg/Process/scheduler/scheduler.html 

...