Professional Documents
Culture Documents
CLO_ PLO_4 C6
Integrate the knowledge in applying system software
3 Investigation ( Creating )
and tools available in modern operating systems.
Q#1
(a) Suppose there are n =10 passenger threads and a car thread. The passengers repeatedly wait
to take rides in the car, which can hold C=3 passengers, where C < n. The car can go around
the tracks only when it is full. Here are some additional details:
(i) Passengers should invoke board and un board.
(ii) The car should invoke load, run and unload.
(iii) Passengers cannot board until the car has invoked load
(iv) The car cannot depart until C passengers have boarded.
(v) Passengers cannot un board until the car has invoked unload.
Synchronize the processes. Write the code using Semaphore and illustrate how your solution can
provide synchronization correctly.
Q#1(b) The program follows to use a shared binary semaphore T.
Process A
int Y;
A1: Y = X*2;
A2: X = Y;
signal(T);
Process B
int Z;
B1: wait(T);
B2: Z = X+1;
X = Z;
T is set to 0 before either process begins execution and, as before, X is set to 5.
Now, how many different values of X are possible after both processes finish executing?
Q3: Examine six memory partitions of size 200 KB, 400 KB, 600 KB, 500 KB, 300 KB and 250
KB. These partitions need to be allocated to four processes of sizes 357 KB, 210 KB, 468 KB and
491 KB in that order.
Q4: Calculate the effective access time (in ns) if the TLB hit ratio is 90% and a paging scheme uses
a Translation Lookaside buffer (TLB). A TLB access takes 10 ns and a main memory access takes
50 ns.
Q.5 Detect a deadlock in the system depicted by the following resource allocation graph?