Top Banner
Scheuduling
17

Scheuduling. Operating System Examples Solaris scheduling Windows XP scheduling Linux scheduling.

Dec 13, 2015

Download

Documents

Jasmine Wade
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Scheuduling. Operating System Examples Solaris scheduling Windows XP scheduling Linux scheduling.

Scheuduling

Page 2: Scheuduling. Operating System Examples Solaris scheduling Windows XP scheduling Linux scheduling.

Operating System Examples

• Solaris scheduling

• Windows XP scheduling

• Linux scheduling

Page 3: Scheuduling. Operating System Examples Solaris scheduling Windows XP scheduling Linux scheduling.

Solaris Dispatch Table

Page 4: Scheuduling. Operating System Examples Solaris scheduling Windows XP scheduling Linux scheduling.

Solaris Scheduling

Page 5: Scheuduling. Operating System Examples Solaris scheduling Windows XP scheduling Linux scheduling.

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

Page 6: Scheuduling. Operating System Examples Solaris scheduling Windows XP scheduling Linux scheduling.

Windows XP Priorities

Page 7: Scheuduling. Operating System Examples Solaris scheduling Windows XP scheduling Linux scheduling.

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)

Page 8: Scheuduling. Operating System Examples Solaris scheduling Windows XP scheduling Linux scheduling.

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

Page 9: Scheuduling. Operating System Examples Solaris scheduling Windows XP scheduling Linux scheduling.

Priorities and Time-slice length

Page 10: Scheuduling. Operating System Examples Solaris scheduling Windows XP scheduling Linux scheduling.

List of Tasks Indexed According to Priorities

Page 11: Scheuduling. Operating System Examples Solaris scheduling Windows XP scheduling Linux scheduling.

Algorithm Evaluation• Deterministic modeling – takes

a particular predetermined workload and defines the performance of each algorithm for that workload

• Queueing models

• Implementation

Page 12: Scheuduling. Operating System Examples Solaris scheduling Windows XP scheduling Linux scheduling.

Evaluation of CPU schedulers by Simulation

Page 13: Scheuduling. Operating System Examples Solaris scheduling Windows XP scheduling Linux scheduling.

Java Thread Scheduling

• JVM Uses a Preemptive, Priority-Based Scheduling Algorithm

• FIFO Queue is Used if There Are Multiple Threads With the Same Priority

Page 14: Scheuduling. Operating System Examples Solaris scheduling Windows XP scheduling Linux scheduling.

Java Thread Scheduling (cont)

JVM Schedules a Thread to Run When:

1.The Currently Running Thread Exits the Runnable State

2.A Higher Priority Thread Enters the Runnable State

* Note – the JVM Does Not Specify Whether Threads are Time-Sliced or Not

Page 15: Scheuduling. Operating System Examples Solaris scheduling Windows XP scheduling Linux scheduling.

Time-SlicingSince 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

Page 16: Scheuduling. Operating System Examples Solaris scheduling Windows XP scheduling Linux scheduling.

Thread Priorities

Priority CommentThread.MIN_PRIORITY Minimum Thread PriorityThread.MAX_PRIORITY Maximum Thread PriorityThread.NORM_PRIORITY Default Thread

Priority

Priorities May Be Set Using setPriority() method:setPriority(Thread.NORM_PRIORITY + 2);

Page 17: Scheuduling. Operating System Examples Solaris scheduling Windows XP scheduling Linux scheduling.

Solaris 2 Scheduling