Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

National Institute of Technology, Kurukshetra

B.Tech. (Computer Engineering) [V Semester


End Sem Exam May Z0Z2
Operatinq Svstems (CSpC-20)
Time: 3 Hrs
MM: 50
Note: Attempt all questions.

Q1- (a) consider a set of n tasks with known runtimes 11, r2,... rn to be run on a uniprocessor
machine. ldentify the cpu scheduting atgorithm that witt resutt in the
l maximum
throughput and whyl
(b) lttustrate spintock and busy-waiting conditions?
(c) Why can't you disattow mutua[ exctusion in order to prevent deadtocks?
Mutuat
exctusion is important for which type of os services? Discuss.
(d) A paging scheme uses a Transtation Lookaside buffer (TLB). The
effective memory
access takes 160 ns and a main memory access takes 100 ns. Determine
the TLB access
time (in ns) if the TLB hit ratio is 60% and there is no page fautt?
e x 4l
Q2. (a) Discuss situations in which the MFU page-reptacement atgorithm generates fewer page
fautts than tl" LRU page-reptacement atgorithm. Atso identify under what
circumstances the opposite hotds.
(b) Consider a muttitevet feedback queue scheduting (MLFBe) with
three queues q1, qZ
and q3. q1 and q2 use round-robin atgorithm with time quantum (Te)
= 5ms, and 4ms
respectivety. q3 uses FCFS atgorithm. Find the average waiting tirne and
average
turnaround time for executing the fottowing process?
Process Burst time (ms)
Pl 8
P2 27
P34
P4 12 (2, 4l
Q3- (a) can a muttithreaded sotution using multipte user teveI threads achieve better
performance on muttiprocessor system than on a singte processor?
Exptain.
(b) Consider the fottowing code segment:
pid tpid;
pid = forkO,.
j-f (pid == 0l l/* child process */
forkO;
thread create(...);
)
forkO;
i. Estimate how many unique processes are created?
ii. Estimate how many unique [hreads are created? (2,2+21
Q4' (a) ldentify the circumstances under which the rate monotonic scheduting is inferior to
eartiest deadtine first scheduting in meeting the deadtines associated with
each
process' Consider two pl'ocesses where p1=50,
t1=25 and pZ=75, t2=30. lttustrate thtr
scheduting of these processes using eartiest cjeadtinL first
scheduting.
(b) lmptement wait ( ) and signar ( ) operations f or a system
using the
test-and set O instruction. Annotate how your sotution is handting busy waitirig.
(4, 4l
Q5' (a) Exptain sotution to the dining phitosophers'problem
using semaphores. Don,t write
the code, onty exptain the strategy.
b) Consider
!h" fottowing pseudocode, where S is a semaphore initiatized to s in
tine #2 and qounter is a shared variabte initiatized to 0 in iine
rt. Assume that the
counter++ operation in line #7 is not atomic. Detect the possibte vatues
that
Counter can have at the end of execution if 5 threads execute
function parop
simuttaneousty? Exptain. Atso check if deadtock is possibte
in given operat.ion or not.
int counter = 0,.
Semaphore S = init(S);
void parop(void)
{
wait (S) ;
wait (S) ;
counter++;
signal (S) ;
signa]- (S) ;
)
(3, 3)
Q6' (a) what happens when an instruction cannot be
executed due to a page fautt may be
during instruction fetch or during operand fetch? How witt this instruction
get executed
eventuatly? Consider different scenarios.
(3)
(b) Define Thrashing? Describe the methods to avoid it.
(3)
(c) lttustrate the goats, principtes, and domain of protection
of operating systems. (3)
Q7' (a) Let a disk drive has 5000 cytinders from o to 4ggg. Currentty drive is at
143'dcytinder, and the previous request was at cytinder 125.
eueue of pending request
in FlFo order I 86, 1470, 913, 1774, g48, 1509, 1027, 130. Evatuate the
total distance
the disk arm moves to satisfy att the pending requests for each of
the fottowing disk
scheduling atgorithms from current position i) FCFS ii) LooK.
(b) Contrast the performance of techniques of aItocating
disk btocks i.e. continuous,
for sequentiar and random access. (4, 3)
::i::-:::-]:o"red
co
co1 1(b), 2(a), 7(b)
c02 +1a;, lffi
co3
co4
co5

THE ENt)

You might also like