Tutorial 4
Tutorial 4
Group 1:
1. Why is deadlock state more critical than starvation? Draw the resource
allocation graph (i) with deadlock (ii) with a cycle but no deadlock.(6
marks)
2. Describe the Bounded - buffer problem and give a solution for the same
using
semaphores. Write the structure of producer and consumer processes.6
marks)
Group 2:
Group 3:
Group 4:
Group 5:
1. Consider a logical address space of 256 pages with a 4-KB page size,
mapped onto
a physical memory of 64 frames. Find the (i) number of bits in the logical
address
(ii) number of bits in the physical address (iii) number of bits in the offset
part of
logical address. (3 marks)
2. Write the algorithm or pseudocode for solving the Dining-Philosophers
problem
using semaphores. Is the solution prone to deadlocks or starvation? Discuss.
(5 marks)
3. Compare the memory organization schemes of pure paging and pure
segmentation
with respect to the following issues: (i) External Fragmentation (ii)
Internal
Fragmentation.(5 marks)
Group 6:
1. Consider the following snapshot of a system with five processes P1, P2,
P3, P4,
P5 and four resources A, B, C, D. What is the total number of instances
of A, B,
C, and D? Using Bankers Algorithm check whether the system is in safe
state
or not. (9 marks)
Group 7:
2. Explain how a process larger than the physical memory can be executed
with the
help of virtual memory. Describe the concept using demand paging.(6
marks)
3. llustrate the wait and signal operations used in semaphores (3 marks)
Group 8:
1. List out the necessary conditions which can lead to a deadlock situation
in a system? (3 marks)
2. Calculate the number of page faults for the following reference string
with three page frames,
using the following algorithms.
9, 2, 3, 1, 2, 5, 3, 4, 6, 9, 9, 1, 0, 5, 4, 6, 2, 3, 0, 1
(i) FIFO (ii) Optimal (iii) LRU (8 marks)
3. Consider the following segment table.
What are the physical addresses for the following logical addresses?
(i) 0, 430 (ii) 1, 10 (iii) 2,500 (iv) 3, 400 (v) 4, 112 (9 marks)