Homework I
1.
Five jobs are waiting to be run. Their expected run times are 9, 6, 3, 5 and X. In
what order should they be run in order to minimize average waiting time? (Hint:
Though the answer is simple, you need to consider all cases).
In class we’ve discussed that shortest job first leads to
minimum
average waiting time.
See class text, p 159. You don’t need to prove it for this question, just remember that
fact. In that case the answer is
a.
0 < X
β
3
: X, 3, 5, 6, 9
b.
3 < X
β
5
: 3, X, 5, 6, 9
c.
5 < X
β
6
: 3, 5, X, 6, 9
d.
6 < X
β
9
: 3, 5, 6, X, 9
e.
X > 9
: 3, 5, 6, 9, X
2.
This problem deals with real time systems with N CPU’s. Events that real time
systems have to respond to are classified as
periodic
or
aperiodic
. Consider the
first case where jobs occur at regular intervals: Let there be
m
periodic events and
event
i
occurs with period
P
i
and
C
i
seconds of CPU time are required to handle
each event, derive an inequality that can be used to show the conditions under
which the periodic load can be handled. (
Hint
: Define CPU utilization, ignore
context switch overhead.)
Utilization is defined as
∑
=
m
i
i
i
P
C
1
and this must be less than or equal to N, i.e., CPU
utilization cannot exceed the number of CPU’s available, and we have assumed N
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
This is the end of the preview.
Sign up
to
access the rest of the document.
 Spring '09
 BRADBART
 Operating Systems, Virtual memory, Central processing unit, real time, real time systems, CPU time

Click to edit the document details