5,023 views
9 votes
9 votes

LRTF ( LONGEST REMAINING TIME FIRST ALGORITHM )  causes starvation or not. please explain.

4 Answers

Best answer
5 votes
5 votes

YES! LRTF is one kind of assigning priority to a process..and every priority scheduling(pre emptive) causes Starvation

now let burst time of p1=2 and a process p2=10 now after evry 2 second a large burst time process is coming

after first 2 second, p1=2 ,p2=8 (let p3 comes with burst time 15s) and then p4,p5 so on

then that p1 will never  get the turn

So it causes Starvation when process are being added to queue

Edit note:shorter process will only get chance whenevr ,the queue will stop fetching any new process

selected by
6 votes
6 votes
LRTF can be starvation free.

Here's the explanation- As we know that if longer processes keeps on coming, than the shorter processes will starve. But upto what extent? It will be upto the time until the memory becomes full, and it cannot take more longer jobs. So there will be a time when longer jobs burst time will match to that of old processes at some point of time since the burst times keeps on decreasing in LRTF. Truly speaking, in LRTF, longer jobs can never go out of CPU(memory) until the shorter ones also get completed.(Just think this statement repeated number of times).

On contrary, in SRTF there is no chance of memory full, and shorter jobs keeps on coming and going out of the cpu after its completion, and longer processes keeps on starving.
3 votes
3 votes

Suppose there are n processes in system/ready queue where a process having maximum burst time of x now consider a case where at every time unit one or more process with burst time greater than x appears in ready queue then what will b the case that at t=0 process with highest burst time x  executed by 1 unit so now as according 2 our assumption system have processes with burst time more than x so cpu alloted to one of that process after that if their burst time reaches equal to x so now 1 process out of n processes must get chance but suppose processes more than burst time x are coming continuously hence it seems that process with burst time less than or equal to x never gets chance so they suffers from starvation but we are wrong here bcoz in practicel we does not have infinite no of processes in system hence after some time process wirh burst time x definetly get chance 2 execute so no starvation is possible here.
  

0 votes
0 votes

LRTF SCHEDULING ALGORITHM NOT CAUSES STARVATION

IF P1=10(burst time),p2=5(b.t),p3=12.

according to LRTF p1 is currently executing when a new process comes with burst time p4=15 so current running process(p1) is preempted .

it execute one unit of time each at a certain time it reaches p1's burst time ,then p1 is higher than p4's burst time.

so there is no chance of starvation problem

Related questions

0 votes
0 votes
2 answers
1
shivang1234 asked Jan 19, 2022
599 views
In round-robin if one process finishes its time quantum and at the same time another process enters the system so which one will enter the ready queue first?
1 votes
1 votes
1 answer
2
iarnav asked Jan 12, 2022
387 views
Does non preemptive CPU scheduling needs hardware support.kindly explain.
1 votes
1 votes
1 answer
3
jayadev asked Oct 10, 2021
1,102 views
in round robin algorithm if a process with burst time = 10 arrived at t=0 and time quantum is 2 units, context switch time is 2 units . Then completion time of the proces...