scheduling.md (821B)
1 priority-based scheduler with preemption. 2 3 | Task | Arrival Time | Exec Time | Priority | 4 | ---- | ------------ | --------- | -------- | 5 | T1 | 5 | 3 | 1 | 6 | T2 | 3 | 4 | 2 | 7 | T3 | 0 | 4 | 3 | 8 9 10 0-3 T3 11 12 T3 has 1 second left then preempted 13 14 3-5 T2 15 16 T2 has 2 seconds left then preempted 17 18 5-8 T1 completes 19 20 8-10 T2 completes 21 22 10-11 T3 completes 23 24 --- 25 26 T1 finishes at 8 27 28 T2 finishes at 10 29 30 T3 finishes at 11 31 32 --- 33 34 single cpu; 10 i/o bound tasks 1 cpu bound 35 i/o bound tasks issue i/o every 1ms 36 i/o operations always take 10ms 37 context switching is .1ms 38 all tasks are long running 39 40 41 1ms timeslice: 42 43 91% cpu utilization 44 45 10ms timeslice: 46 47 95% total utilization then. 48 49 --- 50 51 This is because of the .1 ms context switching 52 53 1ms / 1ms + .1 ms = .91