I have a doubt regarding the no of context switches needed in any scheduling algorithm. assume we have 5 processes, which require 4, 6, 7,5 and 1 time units and arrive at times 0, 1, 2,3, and 5
respectively. How many context switches are needed if
the operating system implements shortest remaining. here if we are doing this firstly we will run |p1| p1| p4| p5| p4| p2|
0 1 4 5 6 10 16 23 so total no of context switches are 7 but in solution the run p1 directly 0 to 4 I wanted to ask how SRTF work internally (as i know it will check firstly for next process arrival time then it will go ahed)