edited by
14,964 views
21 votes
21 votes

Which one or more of the following $\text{CPU}$ scheduling algorithms can potentially cause starvation?

  1. First-in First-Out
  2. Round Robin
  3. Priority Scheduling
  4. Shortest Job First
edited by

5 Answers

21 votes
21 votes

Please find the complete draft here – Link

 

The possible answers are either (A,C,D) or (C,D)
both answers are supported by standard resources.

 

 

Shortest Job First and Priority Scheduling are prone to suffering from starvation.


Shortest Job First(SJF): New shorter jobs may keep on coming.

Priority: Higher priority jobs may keep on coming.

 

Round Robin will never lead to starvation because every job will get a time after a FIXED time quantum.
Since the time quantum is finite, eventually every job will get a chance to run after a finite amount of time. It is worth noting that the time quantum can be set to a large value, such as 10 minutes, 10 years, or even 100 years, but as long as it is finite, every job will receive a chance to execute.

 Now let’s talk about FCFS.



Can First Come First Serve lead to Starvation?

Just imagine a first job submitted to CPU is –

while(1);


Yes, Infinite loop. Do you think other jobs will ever get a chance?

Page 32 https://inst.eecs.berkeley.edu/~cs162/su20/static/lectures/12.pdf


 

Also, check below source- 
https://people.eecs.berkeley.edu/~kubitron/courses/cs162-F08/exams/fa07mt1-solutions.pdf

But there are other standard resources too which say NO Starvation

check  Page 10 https://www.cse.iitb.ac.in/~rkj/cs347/additional/lectures/scheduling.pdf

 

Let’s wait for GATE official answer key.

In our opinion, you can challenge either of the cases once the key comes.

10 votes
10 votes
Some History on this question:

What a controversy this was….

Telegram was full of people fighting which one should be correct out of A,C,D and C,D

Both A,C,D and C,D were accepted as answers finally by IITK
Anyway GO was first to predict this answer accurately, probably within 10 days after the exam
8 votes
8 votes

Answer should be both A,C,D and C,D.

I have attached some slides from universities and Books in favor that there is no starvation in FCFS.

IIT Bombay:

https://www.cse.iitb.ac.in/~rkj/cs347/additional/lectures/scheduling.pdf#page=10

University of Waterloo:

https://student.cs.uwaterloo.ca/~cs350/S10/notes/_Scheduling.pdf#page=9

The University of Texas at Austin:

https://www.cs.utexas.edu/users/dahlin/Classes/UGOS/lectures/lec3.pdf#page=7

University of California San Diego:

https://cseweb.ucsd.edu/classes/fa05/cse120/lectures/120-l8.pdf#page=8

University of Edinburgh,UK

https://www.inf.ed.ac.uk/teaching/courses/os/slides/09-sched.pdf#page=15

 

Operating System Concepts Tenth Edition (Galvin)

https://os.ecci.ucr.ac.cr/slides/Abraham-Silberschatz-Operating-System-Concepts-10th-2018.pdf#page=324

official Answer is given as,

 

It is mentioned in Question 5.7 that  “ the FCFS algorithm is the RR algorithm with an infinite time quantum”. So, if FCFS algorithm has starvation then RR algorithm can also potentially have starvation.

https://os.ecci.ucr.ac.cr/slides/Abraham-Silberschatz-Operating-System-Concepts-10th-2018.pdf#page=320

Operating Systems Internals And Design Principles Seventh Edition William Stallings

https://engineering.futureuniversity.com/BOOKS%20FOR%20I/William%20Stallings%20-%20Operating%20Systems%20(1).pdf#page=425

 

edited by
5 votes
5 votes

The answer is C, D.

Starvation is also called “Indefinite Blocking”. This definition and the word indefinite in particular are important here. With priority and SJF scheduling a process may be blocked for an indefinite(i.e, we cannot say how long it will take to run but it will get its chance at some point in time mostly because of aging techniques) time period when a stream of high-priority processes enters the system. In fact, starvation is associated with only priority-based algorithms.

In FCFS, either the process runs or blocks permanently(definitely). There is no indefinite blocking happening here. So, no starvation.

edited by
Answer:

Related questions

8 votes
8 votes
1 answer
1
admin asked Feb 15, 2023
10,121 views
Which one or more of the following need to be saved on a context switch from one thread $\text{(T1)}$ of a process to another thread $\text{(T2)}$ of the same process?Pag...
12 votes
12 votes
4 answers
2
admin asked Feb 15, 2023
11,871 views
Which one or more of the following options guarantee that a computer system will transition from user mode to kernel mode?Function Callmalloc CallPage FaultSystem Call