Concurrency : mutual exclusion and syncronization
Questions
1.What are the 4 conditions to produce deadlock?
2.Explain the use of resource allocation graph.
3.Write a short note on dead lock avoidance.
4.Write a note on Banker’s algorithm.
5.Describe 2 methods for deadlock recovery.
6.Describe Banker’s algorithm. How does deadlock detection take place? State the time complexity of deadlock avoidance and deadlock detection algorithm.
7.Apply the deadlock detection algorithm to the following data and show the result.
Available = [2,1,0,0]
Request = 2 0 0 1 Allocation = 0 0 1 0
1 0 1 0 2 0 0 1
2 1 0 0 0 1 2 0
If a request [1 1 0 0] comes from a process will it be granted? Will the system still remain in safe state?
8.Write a safety algorithm in the deadlock problem and state its time complexity consider following snap shot of system at time T0
| Allocation | Max | Available |
| A B C | A B C | A B C |
|
|
| 3 3 2 |
P0 | 0 1 0 | 7 5 3 |
|
P1 | 3 0 2 | 3 2 2 |
|
P2 | 3 0 2 | 9 0 2 |
|
P3 | 2 1 2 | 2 2 2 |
|
P4 | 0 0 2 | 4 3 3 |
|
Calculate the need matrix and state whether the system is safe. If yes, justify with stepwise calculations. Give safe sequence.
9.Describe Banker’s algorithm with pseudo code.
10.What is the difference between program and process?
11.What are the fundamental requirements of concurrent processes.
12.Define the terms:
(i) Deadlock (ii) Livelock.
13.Define the producer/consumer problem.
14.Write a short note on : critical section and mutual exclusion.
15.Explain Dekker’s solution to critical section problem.
16.Write a short note on monitors and explain its structure.
17.Implement the reader-writer problem using semaphores and discuss how the critical section requirements are fulfilled.
18.Implement the producer-consumer problem using monitors and discuss how the critical section requirements are fulfilled?
19.Implement the dining philosopher problem using semaphores and discuss how the critical section requirements are fulfilled?
20.Specify the various requirements to meet mutual exclusion. Describe various hardware approaches to achieve mutual exclusion and state its advantages.
21.What is busy waiting with respect to process synchronization? Explain how semaphore reduces severity of this problem. Also define with example:
(i) General semaphores (ii) Binary semaphores
(iii) Strong semaphores (iv) Weak semaphores
22.What is inter-process communication?
23.What are the synchronization primitives used by the message passing system.
24.Explain message passing system for RPC and synchronization.