Quantcast
Channel: Active questions tagged operating-system+scheduling - Stack Overflow
Viewing all articles
Browse latest Browse all 209

Shortest remaining time Job first scheduling algorithm clarification

$
0
0

I was going through the various scheduling algorithm and came across the shortest remaining time Job fist algorithm.

What I understand: Shortest remaining time job first algorithm is the preemptive version of the shortest time job algorithm. Here when a new process with lower burst time has arrived,it prempts the current process and the the new process is executed.

I came across a website while doing my study. The link for the site :

https://www.studytonight.com/operating-system/shortest-job-firstPre-emptive shortest job

What I Don't understand is that the author of the article says that when a process P4 with a CPU burst time of 2ms arrives and process P2 with a remaining burst time of 1ms is executed,P2 is pre-empted. Why is that so? Shouldn't P4 be put to the ready queue since it has more burst time than the remaining burst time of P2?

I understand the fact that burst times are compared and in this way the cpu burst time of P2 is (3ms) more than the CPU burst time of p4(2ms).But since 2 burst time have already been executed, the remaining burst time of p2 is less than that of p4.Why is it preempted?


Viewing all articles
Browse latest Browse all 209

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>