=========================preview======================
(COMP252)final99F_sol.pdf
Back to COMP252 Login to download
======================================================
COMP 252 Principles of Systems Software
Fall Semester 1999
Final Examination
Date: December 16, Time 8:30am C 11:30 am
Name:__SOLUTION_________Student ID:________________Email:_______________
Instructions:
1.
This examination paper consists of 7 pages and 7 questions.
2.
Please write your name, student ID and Email on this page.
3.
For each subsequent page, please write your student ID at the top of the page in the space provided.
4.
Please answer all the questions within the space provided on the examination paper. You may use the back of the pages for your rough work.
5.
Please read each question very carefully and answer the question clearly and to the point. Make sure that your answers are neatly written, readable and legible.
6.
Show all the steps you use in deriving your answer, where ever appropriate.
7.
For each of the questions assume that the concepts are known to the graders. Concentrate on answering to the point what is asked. Do not define or describe the concepts.
Question Points Score
1 19
2 9
3 10
4 20
5 15
6 12
7 15
TOTAL 100
1) a) If the time quantum in a time-sharing system is tq and the average overhead due to swapping and context switching is ts, discuss the problems associated with the values:
tq --> infinity
tq <= ts
tq = constant (3 points each)
i) If tq .
infinity, the algorithm degenerates to FIFO (non-preemptive) so short jobs may have to wait behind long jobs.
ii) For tq <= ts the overhead of swapping and context switching is higher than the actual time to work on the user job. The system spends much time in just bringing jobs in and out of main memory and switching jobs. This may lead to thrashing and low throughput. The system utilization will also be low.
iii) tq = constant. The problem is what value to assign to tq. If it is too large, the response time will be high (not interactive, see answer i) above). If it is too small, the system throughput will suffer (see answer ii)).
b) Consider a variant of the RR scheduling algorithm where the entries in the ready queue are pointers to the PCBs (Process Control Blocks).
(i) What would be the effect of putting two pointers to the same process in the ready queue ? (3 points)
The process will get two quantum times per round.
(ii) What would be the major advantages and disadvantages of this
scheme ? (3 points)
Advantage: simple way to assign more CPU time to some processes without having to
change the underlying scheduling algorithm.
Disadvantage: i) the process may not be `ready when the 2nd pointer is encountered. ii) overhead of possibly two context switches for the process to get two quantum time.
(iii) How would you modify the basic RR algorithm to achieve the same effect without the
duplicate pointers ? (4 points)
One way is as follows: For the favoured processes (those we wish to assign a longer quantum time), set the t