The material for the questions below
can be found in any operating system text.
Remember, no hand written material.
Use a text processor - you might try troff
or latex/xfig.
Also remember to date and time stamp your homework.
Consider a computer that does not have a
Test & Set Lock
instruction, but does have an instruction to swap
the contents of a register and a memory word in
a single indivisible action.
Can that be used to write a routine
enter_region
such as the one discussed in class.
Measurements of a certain system have shown that the
average process runs for a time
T before blocking on i/o.
A process switch requires a time S,
which is effectively wasted (overhead).
For round robin scheduling with quantum Q, give a formula
for the CPU efficiency for each of the following:
Note: CPU efficiency = useful CPU time / total CPU time
A soft real-time system has four periodic events
with periods of 50, 100, 200,
and 250 msec each.
Suppose that the four events required 35, 20, 10,
and X msec of CPU time,
respectively.
What is the largest value of X
for which the system is schedulable.
Five jobs are waiting to be run.
Their expected run timers are 9, 6, 3, 5, and X.
In what order should they be run to minimize average response time?
(Your answer will depend on X).
Consider a variant of the RR (RoundRobin) scheduling algorithm where the entries
in the ready queue are pointers to the PCBs (Process Control Block).
Suppose that a scheduling algorithm
(at least of short-term CPU scheduling)
favors those processes that have used the least
processor time in the recent past.
Why will this algorithm favor I/O bound programs
and yet not permanently starve CPU-bound programs?
Turn in an annotated script file of your ps answering
the questions above.
Students working at individual PCS in a computer lab send their
files to be printed by a server which spools the files on its hard
disk.
Under what conditions may a deadlock occur if the disk pack for the print
spool is limited?
How may the deadlock be avoided?
In the preceding question which resources are preemptable and
which are nonpreemptable?
The banker's algorithm is being run in a system with
m
resource classes and
n
processes.
In the limit of large
m
and
n,
the number of operations that must be performed to check a state
for safety is proportional to
m**a * n**b.
What are the values of
a
and
b.
Note: ** is exponentiation,
which could have been written m^a, but i use to do Fortran.
A computer science student assigned to work on deadlocks thinks
of the following brilliant way to eliminate deadlocks.
When a process requests a resource, it specifies a time limit.
If the process blocks because the resource is not available,
a timer is started.
If the time limit is exceeded, the process is released and allowed
to run again.
If you were the professor, what grade would you give this proposal
and why?
Last modified October 2, 2001 by mike@cs.hmc.edu