Consider the following three processes, with arrival time and CPU burst time in milliseconds: P1 (arrival 0, burst 7), P2 (arrival 1, burst 4), P3 (arrival 2, burst 8). The Gantt chart for the preemptive SJF scheduling algorithm is
Pick an option to check yourself, or open the answer below.
Show answer & explanation
Correct answer: B. 
Explanation
P1 starts at 0. At t = 1, P2 (4) is shorter than P1's remaining 6, so it pre-empts and runs 1–5. Then P1 (6) beats P3 (8), running 5–11, and P3 runs 11–19: chart B.
More System Software and Operating System questions
- In which of the following scheduling criteria, context switching will never take place?
- Consider a virtual page reference string 1, 2, 3, 2, 4, 2, 5, 2, 3, 4. Suppose LRU page replacement algorithm is implemented with 3 page fr…
- Page information in memory is also called as Page Table. The essential contents in each entry of a page table is/are _________.
- Which of the following statements are true ? (a) External Fragmentation exists when there is enough total memory space to satisfy a request…
- Which UNIX/Linux command is used to make all files and sub-directories in the directory “progs” executable by all users ?
- Normally user programs are prevented from handling I/O directly by I/O instructions in them. For CPUs having explicit I/O instructions, suc…