os examples scheduling

5
Operating systems By : Dana Dia'a

Upload: dana-dia

Post on 15-Aug-2015

16 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Os examples scheduling

Operating systems

By : Dana Dia'a

Page 2: Os examples scheduling

Linux scheduling

In Linux, tasks are divided into classes and the processor chooses

the algorithm based on the priority assigned for each class. The

aspects in which processor schedule tasks may be different based

on priority. The scheduling criteria, for example: Android is based

on Linux differs from Windows which is based on Linux, too, and

they all are different from Linux-based servers. To determine the

next task to be running, the scheduler selects the highest priority in

the highest -priority scheduling class. In Linux, there are two

scheduling classes: default scheduling class; using completely fair

scheduler (CFS), and a real-time scheduling class.

According to CFS scheduling algorithms, CPU process time is

divided upon tasks and the proportion is based on the nice value

(lower value is higher relative priority; which means higher

proportion of CPU process time). Priority does not assign directly

by CFS scheduling; instead, time is recorded by the virtual-run

time.

Page 3: Os examples scheduling

Windows scheduling

Windows threads use a priority-based, preemptive scheduling.

Highest priority runnable thread always runs. Windows dispatcher

(handles the scheduler) gives control to the thread selected by the

short term scheduler, a dispatch will run a selected thread until it is

distracted by one of these condition: is preempted by a higher-

priority thread, it terminates, its time quantum end, or blocking

system call (such as I/O) .

In Windows scheduling (dispatcher), when higher priority thread is

ready to run and need access, it preempt the running lower

priority. Priorities are divided into two classes: the variable class

and the real-time class. The dispatcher uses a queue for each

scheduling priority and order the set of queues from the highest to

lowest until it finds a thread that is ready to run, if it doesn’t find a

ready thread, it executes an idle thread. The priority for each

thread is based on both the priority class and its relative priority.

Page 4: Os examples scheduling

Solaris scheduler

Solaris uses six classes priority-based thread scheduling in which

each class is divided into different priorities and algorithms. The

default is time sharing; which alters priorities and assigns different

lengths time-slices dynamically by multilevel feedback queue

(inverse relationship; the higher the priority, the smaller the time-

slice and vice versa). The interactive processes -higher priority

typically- gives a good response time. It uses a scheduling policy

as time-sharing but gives windowed-applications a higher priority.

The Solaris kernel is fully promotable, this means that all threads

to allow a higher priority thread to run. Threads in real-time class

are given the highest priority, guaranteed response time. In system

class, kernel processes are assigned to this class, and priorities

are static. In fixed and fair priority, no dynamic adjustment of

priorities. Solaris uses a dispatch table; this is used to assign a

new priority to a process in two cases: time quantum expired

without blocking, process blocked before time quantum expired.