1 / 37

CHAPTER 2 PROCESSOR SCHEDULING PART III

CHAPTER 2 PROCESSOR SCHEDULING PART III. by Uğur HALICI. 2.3.2 Shortest-Process-First (SPF). In this method, the processor is assigned to the process with the smallest execution (processor burst) time . This requires future knowledge of the execution time.

sheryl
Télécharger la présentation

CHAPTER 2 PROCESSOR SCHEDULING PART III

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CHAPTER 2PROCESSOR SCHEDULINGPART III by Uğur HALICI

  2. 2.3.2 Shortest-Process-First (SPF) • In this method, the processor is assigned to the process with the smallest execution (processor burst) time. • This requires future knowledge of the execution time. • In our examples, it is given as a table but actually these burst times are not known by the OS. So it makes prediction. • One approach for this prediction is using the previous processor burst times for the processes in the ready queue and then the algorithm selects the shortest predicted next processor burst time.

  3. 2.3.2 Shortest-Process-First (SPF) SPF next_cpu_burst FCFS

  4. 2.3.2 Shortest-Process-First (SPF) Proc_id : next_cpu_burst

  5. 2.3.2 Shortest-Process-First (SPF)

  6. 2.3.2 Shortest-Process-First (SPF)

  7. 2.3.2 Shortest-Process-First (SPF)

  8. 2.3.2 Shortest-Process-First (SPF)

  9. 2.3.2 Shortest-Process-First (SPF)

  10. 2.3.2 Shortest-Process-First (SPF)

  11. 2.3.2 Shortest-Process-First (SPF)

  12. 2.3.2 Shortest-Process-First (SPF)

  13. 2.3.2 Shortest-Process-First (SPF)

  14. 2.3.2 Shortest-Process-First (SPF)

  15. 2.3.2 Shortest-Process-First (SPF)

  16. 2.3.2 Shortest-Process-First (SPF)

  17. 2.3.2 Shortest-Process-First (SPF)

  18. 2.3.2 Shortest-Process-First (SPF)

  19. 2.3.2 Shortest-Process-First (SPF)

  20. 2.3.2 Shortest-Process-First (SPF)

  21. 2.3.2 Shortest-Process-First (SPF)

  22. 2.3.2 Shortest-Process-First (SPF) • Processor utilization = (35 / 35) * 100 = 100 % • Throughput = 4 / 35 = 0.11

  23. 2.3.2 Shortest-Process-First (SPF) • Turn around time: tatA = 35 – 0 = 35 tatB = 31 – 2 = 29 tatC = 17 – 3 =14 tatD = 23 – 7 = 16 tatAVG = (35 + 29 + 15 + 16) / 4 = 23.5

  24. 2.3.2 Shortest-Process-First (SPF) • Turn around time: tatA = 35 – 0 = 35 tatB = 31 – 2 = 29 tatC = 17 – 3 =14 tatD = 23 – 7 = 16 tatAVG = (35 + 29 + 15 + 16) / 4 = 23.5

  25. 2.3.2 Shortest-Process-First (SPF) • Turn around time: tatA = 35 – 0 = 35 tatB = 31 – 2 = 29 tatC = 17 – 3 =14 tatD = 23 – 7 = 16 tatAVG = (35 + 29 + 15 + 16) / 4 = 23.5

  26. 2.3.2 Shortest-Process-First (SPF) • Turn around time: tatA = 35 – 0 = 35 tatB = 31 – 2 = 29 tatC = 17 – 3 =14 tatD = 23 – 7 = 16 tatAVG = (35 + 29 + 15 + 16) / 4 = 23.5

  27. 2.3.2 Shortest-Process-First (SPF) • Turn around time: tatA = 35 – 0 = 35 tatB = 31 – 2 = 29 tatC = 17 – 3 =14 tatD = 23 – 7 = 16 tatAVG = (35 + 29 + 15 + 16) / 4 = 23.5

  28. 2.3.2 Shortest-Process-First (SPF) • Waiting time: wtA = (0 – 0) + (18 – 8) + (31 – 26) = 15 wtB = (6 – 2) + (23 – 15) = 12 wtC = (4 – 3) + (15 – 9) = 7 wtD = (14 – 7) + (17 – 16) + (22 – 19) = 11 wtAVG = (15 + 12 + 7 + 11) / 4 = 11.25

  29. 2.3.2 Shortest-Process-First (SPF) • Waiting time: wtA = (0 – 0) + (18 – 8) + (31 – 26) = 15 wtB = (6 – 2) + (23 – 15) = 12 wtC = (4 – 3) + (15 – 9) = 7 wtD = (14 – 7) + (17 – 16) + (22 – 19) = 11 wtAVG = (15 + 12 + 7 + 11) / 4 = 11.25

  30. 2.3.2 Shortest-Process-First (SPF) • Waiting time: wtA = (0 – 0) + (18 – 8) + (31 – 26) = 15 wtB = (6 – 2) + (23 – 15) = 12 wtC = (4 – 3) + (15 – 9) = 7 wtD = (14 – 7) + (17 – 16) + (22 – 19) = 11 wtAVG = (15 + 12 + 7 + 11) / 4 = 11.25

  31. 2.3.2 Shortest-Process-First (SPF) • Waiting time: wtA = (0 – 0) + (18 – 8) + (31 – 26) = 15 wtB = (6 – 2) + (23 – 15) = 12 wtC = (4 – 3) + (15 – 9) = 7 wtD = (14 – 7) + (17 – 16) + (22 – 19) = 11 wtAVG = (15 + 12 + 7 + 11) / 4 = 11.25

  32. 2.3.2 Shortest-Process-First (SPF) • Waiting time: wtA = (0 – 0) + (18 – 8) + (31 – 26) = 15 wtB = (6 – 2) + (23 – 15) = 12 wtC = (4 – 3) + (15 – 9) = 7 wtD = (14 – 7) + (17 – 16) + (22 – 19) = 11 wtAVG = (15 + 12 + 7 + 11) / 4 = 11.25

  33. 2.3.2 Shortest-Process-First (SPF) • Response time: rtA = 0 – 0 = 0 rtB = 6 – 2 = 4 rtC = 4 – 3 = 1 rtD = 14 – 7 = 7 rtAVG = (0 + 4 + 1 + 7) / 4 = 3

  34. 2.3.2 Shortest-Process-First (SPF) • Response time: rtA = 0 – 0 = 0 rtB = 6 – 2 = 4 rtC = 4 – 3 = 1 rtD = 14 – 7 = 7 rtAVG = (0 + 4 + 1 + 7) / 4 = 3

  35. 2.3.2 Shortest-Process-First (SPF) • Response time: rtA = 0 – 0 = 0 rtB = 6 – 2 = 4 rtC = 4 – 3 = 1 rtD = 14 – 7 = 7 rtAVG = (0 + 4 + 1 + 7) / 4 = 3

  36. 2.3.2 Shortest-Process-First (SPF) • Response time: rtA = 0 – 0 = 0 rtB = 6 – 2 = 4 rtC = 4 – 3 = 1 rtD = 14 – 7 = 7 rtAVG = (0 + 4 + 1 + 7) / 4 = 3

  37. 2.3.2 Shortest-Process-First (SPF) • Response time: rtA = 0 – 0 = 0 rtB = 6 – 2 = 4 rtC = 4 – 3 = 1 rtD = 14 – 7 = 7 rtAVG = (0 + 4 + 1 + 7) / 4 = 3

More Related