Lecture 12: Uniprocessor scheduling

Previous lecture Next lecture

Exam

Processors and processor time as a resource and its management

Important questions:

Processes once again…

current operating system

manage processes and to provide communication channels

Dispatch states

Depending on the scheduling level, every process is assigned a logical state representing its dispatch state at a given point in time:

*Rule of thumb how often a scheduling decision or state change occurs

Short-term scheduling

Medium-term scheduling

A process is completely swapped out

The process has to wait to be swapped in:

Long-term scheduling

State transitions

Scheduling points

First-Come First-Served – FCFS

Discussion: FCFS – "convoi effect"

FCFS is not a suitable approach

Round Robin (RR)

Discussion: RR – performance problems

inequally βž› CPU-intensive processes get a larger share

Virtual Round Robin (VRR)

Shortest process next (SPN)

Discussion: SPN – weighting bursts

single CPU bursts in the time line of the process

This statistical approach is also called exponential smoothing.

Shortest Remaining Time First (SRTF)

Highest Response Ratio Next – HRRN

Feedback (FB)

Discussion: Priorities

Combination – Multi-level scheduling

"simultaneously"), e.g. support of

Objectives for evaluation

Quantative comparison

Qualitative comparison

Scheduling in Unix

prio = cpu_usage + p_nice + base

UNIX – 4.3 BSD (1)

a second:

Pcpuβ€…β€ŠβŸΈβ€…β€Š2β‹…load2β‹…load+1β‹…Pcpu+PniceP_{cpu} \impliedby \frac{2 \cdot load}{2 \cdot load + 1} \cdot P_{cpu} + P_{nice}

more than 1 second:

Pcpuβ€…β€ŠβŸΈβ€…β€Š(2β‹…load2β‹…load+1)Pslptimeβ‹…PcpuP_{cpu} \impliedby \left( \frac{2 \cdot load}{2 \cdot load + 1} \right)^{P_{slptime}} \cdot P_{cpu}

UNIX – 4.3 BSD (2)

for an assumed average load of 1: Pcpu := 0.66 Β· Pcpu + Pnice

interval i and Pnice = 0

Pcpu1 = 0.66 T0
Pcpu2 = 0.66 (T1 + 0.66 T0 ) = 0.66 T1 + 0.44 T0
Pcpu3 = 0.66 T2 + 0.44 T1 + 0.30 T0
Pcpu4 = 0.66 T3 + … + 0.20 T0
Pcpu5 = 0.66 T4 + … + 0.13 T0

Windows NT – Priority classes

NT – Adaptive priorities

Conclusions