Dispatcher must be fast Scheduling Criteria CPU Utilization Keep the CPU and

Dispatcher must be fast scheduling criteria cpu

This preview shows page 12 - 23 out of 37 pages.

° Dispatcher must be fast.
Image of page 12
Scheduling Criteria ° CPU Utilization ° Keep the CPU and other resources as busy as possible ° Throughput ° # of processes that complete their execution per time unit. ° Turnaround time ° amount of time to execute a particular process from its entry time.
Image of page 13
Scheduling Criteria (cont.) ° Waiting time ° amount of time a process has been waiting in the ready queue. ° Response Time (in a time-sharing environment) ° amount of time it takes from when a request was submitted until the first response is produced, NOT output.
Image of page 14
Optimization Criteria ° Max CPU Utilization ° Max Throughput ° Min Turnaround time Min Waiting time ° ° Min response time
Image of page 15
First Come First Serve (FCFS) Scheduling ° Policy: Process that requests the CPU FIRST is allocated the CPU FIRST. ± FCFS is a non-preemptive algorithm. ° Implementation - using FIFO queues ± incoming process is added to the tail of the queue. ± Process selected for execution is taken from head of queue. ° Performance metric - Average waiting time in queue. ° Gantt Charts are used to visualize schedules.
Image of page 16
First-Come, First-Served(FCFS) Scheduling ° Example Process Burst Time P1 24 P2 3 P3 3 ° Suppose the arrival order for the processes is ° P1, P2, P3 ° Waiting time ° P1 = 0; ° P2 = 24; ° P3 = 27; ° Average waiting time ° (0+24+27)/3 = 17 0 24 27 30 P1 P2 P3 Gantt Chart for Schedule
Image of page 17
FCFS Scheduling (cont.) ° Example Process Burst Time P1 24 P2 3 P3 3 ° Suppose the arrival order for the processes is ° P2, P3, P1 ° Waiting time ° P1 = 6; P2 = 0; P3 = 3; ° Average waiting time ° (6+0+3)/3 = 3 , better.. ° Convoy Effect : ± short process behind long process, e.g. 1 CPU bound process, many I/O bound processes. 0 3 6 30 P1 P2 P3 Gantt Chart for Schedule
Image of page 18
Shortest-Job-First(SJF) Scheduling ± Associate with each process the length of its next CPU burst. Use these lengths to schedule the process with the shortest time. ± Two Schemes: ° Scheme 1: Non-preemptive ± Once CPU is given to the process it cannot be preempted until it completes its CPU burst. ° Scheme 2: Preemptive ± If a new CPU process arrives with CPU burst length less than remaining time of current executing process, preempt. Also called Shortest-Remaining-Time-First (SRTF). ° SJF is optimal - gives minimum average waiting time for a given set of processes.
Image of page 19
Non-Preemptive SJF Scheduling ° Example Process Arrival TimeBurst Time P1 0 7 P2 2 4 P3 4 1 P4 5 4 0 8 16 P1 P2 P3 Gantt Chart for Schedule P4 12 7 Average waiting time = (0+6+3+7)/4 = 4
Image of page 20
Preemptive SJF Scheduling(SRTF) ° Example Process Arrival TimeBurst Time P1 0 7 P2 2 4 P3 4 1 P4 5 4 0 7 16 P1 P2 P3 Gantt Chart for Schedule P4 11 5 Average waiting time = (9+1+0+2)/4 = 3 P2 P1 2 4
Image of page 21
Determining Length of Next CPU Burst ° One can only estimate the length of burst. ° Use the length of previous CPU bursts and perform exponential averaging.
Image of page 22
Image of page 23

You've reached the end of your free preview.

Want to read all 37 pages?

  • One '20
  • Computer multitasking

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern

Ask Expert Tutors You can ask You can ask ( soon) You can ask (will expire )
Answers in as fast as 15 minutes