Presentation is loading. Please wait.

Presentation is loading. Please wait.

Scheuduling.

Similar presentations


Presentation on theme: "Scheuduling."— Presentation transcript:

1 Scheuduling

2 Operating System Examples
Solaris scheduling Windows XP scheduling Linux scheduling

3 Solaris Dispatch Table

4 Solaris Scheduling

5 Unix Scheduling Interactive processes are favored
- Small CPU time slices are given to processes by a priority algorithm Round Robin for CPU-bound jobs The more CPU time a process accumulates, the lower its priority becomes (negative feedback) “Process aging” prevents starvation Multi-level Feedback Queue with Round Robin within each priority queue Priority is based on process type and execution history

6 Windows XP Priorities

7 Linux Scheduling Constant order O(1) scheduling time
Two priority ranges: time-sharing and real-time Real-time range from 0 to 99 and nice value from 100 to 140 (figure 5.15)

8 Linux Scheduling Each process gets a time quantum, based on its priority - Two arrays of runnable processes, active and expired - Processes are selected to run from the active array - When quantum exhausted, process goes on expired - When active is empty, swap the two arrays

9 Priorities and Time-slice length

10 List of Tasks Indexed According to Priorities

11 Algorithm Evaluation Deterministic modeling – takes a particular predetermined workload and defines the performance of each algorithm for that workload Queueing models Implementation

12 Evaluation of CPU schedulers by Simulation

13 Java Thread Scheduling
JVM Uses a Preemptive, Priority-Based Scheduling Algorithm FIFO Queue is Used if There Are Multiple Threads With the Same Priority

14 Java Thread Scheduling (cont)
JVM Schedules a Thread to Run When: The Currently Running Thread Exits the Runnable State A Higher Priority Thread Enters the Runnable State * Note – the JVM Does Not Specify Whether Threads are Time-Sliced or Not

15 Time-Slicing Since the JVM Doesn’t Ensure Time-Slicing, the yield() Method May Be Used: while (true) { // perform CPU-intensive task . . . Thread.yield(); } This Yields Control to Another Thread of Equal Priority

16 Thread Priorities Priority Comment
Thread.MIN_PRIORITY Minimum Thread Priority Thread.MAX_PRIORITY Maximum Thread Priority Thread.NORM_PRIORITY Default Thread Priority Priorities May Be Set Using setPriority() method: setPriority(Thread.NORM_PRIORITY + 2);

17 Solaris 2 Scheduling


Download ppt "Scheuduling."

Similar presentations


Ads by Google