edited by
41,022 views
58 58 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

4 Answers

75 75 votes

Some History on this question:

What a controversy this was…

Telegram was full of people saying C, D is correct.

GO Classes was the first to say that even FCFS may have starvation — no one believed us, but we said it immediately after the paper was done.

See this video — we went live right after the paper ended: Watch Here 🎥

Also, see this follow-up session we conducted a day later: Watch Here 🎬

Both A, C, D and C, D were finally accepted as answers by IIT Kanpur. Anyway, GO Classes was the first to predict this answer accurately.


Please find the complete draft which we have submitted to challenge this question

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 Scheduling:
Higher priority jobs may keep on coming.

Round Robin (RR) scheduling will never lead to starvation because every job is guaranteed CPU time after a fixed time quantum.

Since the time quantum is finite, each process eventually gets its turn to execute after a finite period, ensuring fairness among all tasks.

It is worth noting that the time quantum can be very large — for example, 10 minutes, 10 years, or even 100 years — but as long as it remains finite, every process will still receive CPU time and starvation will not occur.

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?

But there are other standard resources too which say NO Starvation 

UCSD No Starvation ❌

UCSD Lecture 8 also mentions that FCFS has no starvation.
Check Page 8 https://cseweb.ucsd.edu/classes/fa05/cse120/lectures/120-l8.pdf#page=8


📝 Edit:

GATE has accepted both (A, C, D) and (C, D) as answers.

edited by
24 24 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
17 17 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
7 7 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
1 1 vote
If infinite burst time is possible:

Ans: A,C,D

But since convoy effect exists, to acknowledge this problem, (and infinite burst not mentioned explicitly) also ans = C,D

Finally after answer challenge both A,C,D and C,D were awarded marks by IITK
Answer:
Position:
Show:

Related questions

34 34 votes
6 6 answers
23.2k
23.2k views
admin asked Feb 15, 2023
23,170 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...
46 46 votes
7 7 answers
29.1k
29.1k views
admin asked Feb 15, 2023
29,059 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
17 17 votes
3 3 answers
16.7k
16.7k views
admin asked Feb 15, 2023
16,704 views
Which of the following statements is/are $\text{CORRECT}?$The intersection of two regular languages is regular.The intersection of two context-free languages is context-f...
35 35 votes
3 3 answers
22.4k
22.4k views
admin asked Feb 15, 2023
22,400 views
Which of the following statements is/are $\text{INCORRECT}$ about the $\textsf{OSPF (Open Shortest Path First)}$ routing protocol used in the Internet?$\textsf{OSPF}$ imp...