Final AOS SPR 2018
Final AOS SPR 2018
Q1 a) Describe the worker-pool architecture for multi-threaded servers with the help of a suitable diagram. [3]
b) Write down the purpose of LWPs in Solaris OS? Identify the information stored in them and show, with the help [3]
of diagram, how they are managed using the PCB of a process.
c) How can ULTs employ an application specific scheduler? Illustrate with a suitable example. [2]
d) A monitor module, boundedbuffer, is used to control the circular buffers for storing and retrieving integers. [2]
Develop the append() procedure to insert an integer in the buffer.
Q2 a) Consider following solution (consumer routine only) to the Bounded-Buffer Producer/Consumer Problem using [4]
semaphores:-
void consumer( )
/* program boundedbuffer */
{ while (true)
const int sizeofbuffer = /* buffer size */;
{ wait(n);
semaphore s = 1;
wait(s);
semaphore n = 0;
take( );
semaphore e = sizeofbuffer;
signal(s);
signal(e);
consume( );
}
}
i. Write down the purpose of semaphore n in the above solution.
ii. Why does wait(n) comes before wait(s) in the above code sequence of consumer?
iii. Suppose n=5, e=5 and s=1 at a particular instant. Then determine the values of these semaphores after two
consecutive iterations of while loop in the consumer routine. Assume no other process interferes in the
meanwhile.
iv. Now determine what happens when s = 0 instead of 1 in (iii).
b) Define the indefinite postponement problem in message passing. [1]
c) Define symmetric message communication. Highlight one of its limitations. [2]
d) Discuss the double-copying message passing mechanism with the help of a diagram. [3]
Q3 a) A machine has a 4-KB page, 128-MB main memory, and a 2-GB virtual address space. How many page table [2]
entries are required in a single-level page table and an inverted page table?
b) Consider a machine architecture having TLB with 128 entries. Suppose that a program A contains instructions [3]
that fit into 18 pages and a stack that needs 30 pages. Now determine how much effective will the TLB be in each
of the following cases:-
i. Program A sequentially reads long integers from an array that spans 100 pages.
ii. Program A repeatedly and randomly reads long integers from an array that spans 100 pages.
c) Suppose it takes 18 nano-secs to search the associative registers and 95 nano-secs to access memory and the hit- [3]
ratio of 92% of accessing associative memory. What will be the effective access time with 3-level page tables?
How much percent is the slow-down in memory-access time?
d) A computer keeps its page tables in memory. The overhead of reading a word from the page table is 4.0 nsec. To [2]
reduce this overhead, the computer has a TLB which can do a look up in 1.3 nsec. What hit-rate is needed to
reduce the mean overhead to 1.8 nsec?
Page 1 of 2
b) If LRU page replacement is used with three page frames and eight pages, how many page faults will occur with [2]
the reference string 27527127527276 if the three page frames are initially empty?
c) Figure below partially shows a page table for a process with 8 pages. Use the Working Set page replacement [3]
algorithm to find the page to be evicted, on the occurrence of page fault, when
i. = 300 msec ii. = 400 msec
Give proper reasoning of your answer.
3142 Current virtual time
Reference bit
1
3062 1
2
3082 1
3
2942 0 Time of last use
4
3067 1
5
2902 0
6
2792 0
7
3087 1
8
2762 0
d) A small computer has five page frames. At the first clock tick, the R bits are 10100. At subsequent clock ticks, [3]
the values are 01100, 00011, 01010, 10100, and 00101. If the aging algorithm is used with an 8-bit counter, give
the values of the five counters after the last tick. Now if a page fault occurs at this point, then determine which of
the page frames will be replaced according to LRU algorithm.
e) Suppose that the R bits for the pages A through J are 1110100010. Which next page will be evicted by the clock [1]
page replacement algorithm if the hand currently points to A? What will be the values of R bits after this
execution of algorithm.
Q5 a) In what situation, a deadlock may occur between different critical regions in an operating system? Mention the [3]
technique for avoiding that deadlock? What further care must be taken for keeping the technique useful? OR
A distributed system comprises four processes P1 through P4. All processes are active; P4 is the coordinator
process. Assuming P1 and P4 fail. Now demonstrate the steps to be followed under the bully version of the
election algorithm for the recovery towards the normal operation of the system.
b) How does affinity-based scheduling improve the performance of a system? Define the two types of affinity-based [2]
scheduling.
c) Consider a system with two applications, one with six threads and the other with three threads running on a [3]
system with six processors using Gang scheduling.
i. Determine how much processing resource is wasted with uniform time allocation.
ii. Now figure out the reduction in processor waste using the scheduling weighted by number of threads.
d) Why is process migration needed due to hardware and software preferences? [2]