Important limit for terminal activities 1 to 2

This preview shows page 17 - 26 out of 93 pages.

Important limit for terminal activities 1 to 2 seconds For keeping user’s attention for thought-intensive activities Example: graphics Less than 1 second Response to key presses or mouse clicks Less than 1/10 second Response Time
Image of page 17

Subscribe to view the full document.

BYU CS 345 Scheduling 18 Scheduling Priorities Are some processes more important than others? Don’t want to starve low-priority processes Decision Mode Will we suspend the currently active process if it can continue? No: Nonpreemptive Yes: Preemptive Some systems (Win 3.1, early Mac) used cooperative multitasking (processes voluntarily give up the CPU) Preemption incurs more O.S. overhead, but prevents monopolizing the processor Also helps with infinite loops Scheduling
Image of page 18
BYU CS 345 Scheduling 19 Scheduling Algorithms First Come First Served (FCFS) Round Robin (RR) – time slicing. Shortest Process Next (SPN) Shortest Remaining Time (SRT) Highest Response Ratio Next (HRRN) Feedback Algorithms
Image of page 19

Subscribe to view the full document.

BYU CS 345 Scheduling 20 0 5 10 15 20 1 2 3 4 5 First-Come-First-Served (FCFS) Process Arrival Service 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2
Image of page 20
BYU CS 345 Scheduling 21 FCFS (continued…) First-Come-First-Served - each process joins the Ready queue When the current process ceases to execute, the oldest process in the Ready queue is selected A short process may have to wait a very long time before it can execute. Favors CPU-bound processes over I/O-bound processes. I/O processes have to wait until CPU-bound process completes FCFS, although not attractive alternative for a uni-processor system, when combined with a priority scheme may prove to be an effective scheduler.
Image of page 21

Subscribe to view the full document.

BYU CS 345 Scheduling 22 Round-Robin (RR) 0 5 10 15 20 1 2 3 4 5 Process Arrival Service 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2
Image of page 22
BYU CS 345 Scheduling 23 Round Robin (continued…) Uses FCFS w/preemption - based on a clock (time slicing). Short time quantum: processes move relatively quickly through the system (with more overhead). The time quantum should be slightly greater than the time required for a typical interaction. Particularly effective in GP time-sharing or transaction processing system. Generally favors processor bound processes as I/O bound give up their time slice while process bound use their complete time quantum. Could be improved using a virtual round robin (VRR) scheduling scheme – implement an auxiliary I/O queue which gets preference over the main queue.
Image of page 23

Subscribe to view the full document.

BYU CS 345 Scheduling 24 Shortest Process Next (SPN) 0 5 10 15 20 1 2 3 4 5 Process Arrival Service 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2
Image of page 24
BYU CS 345 Scheduling 25 Shortest Process Next Shortest Process Next - Non-preemptive policy Process with shortest expected processing time is selected next Short process jumps ahead of longer processes May be impossible to know or at least estimate the required processing time of a process.
Image of page 25

Subscribe to view the full document.

Image of page 26
You've reached the end of this preview.
  • Winter '12
  • EricMercer
  • Scheduling algorithms, FCFS, BYU CS

{[ snackBarMessage ]}

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