You are on page 1of 1

DUTTA COMPUTER ACADEMY, www.duttacomputeracademy.co.

in
2/86 Bibekanagar, Kolkata-700075
M: 8017687140 / 7278081991

Important Questions of Deadlock

1. What is deadlock? Write down the necessary conditions for deadlock.


2. How can deadlock be prevented?
3. State the difference between deadlock and starvation.
4. State the Bernstein's Concurrency condition.
Bernstein's Conditions
A. If process Pi writes to a memory cell Mi, then no process Pj can read the cell
Mi.
B. If process Pi read from a memory cell Mi, then no process Pj can write to the
cell Mi.
C. If process Pi writes to a memory cell Mi, then no process Pj can write to the
cell Mi.
5. Define starvation. Solution of starvation.
6. Explain bankers algorithm, for deadlock avoidence.
7. Explain mutual exclusion. Write the first algorithm for mutual exclusion algorithm.
(Dekkers Algorithm).
Answer:
Critical Section Problem: Dekker's Algorithm

Dekker's algorithm was the first provably-correct solution to the critical section
problem. It requires both an array of boolean values and an integer variable:

var flag: array [0..1] of boolean;


turn: 0..1;
repeat

flag[i] := true;
while flag[j] do
if turn = j then
begin
flag[i] := false;
while turn = j do no-op;
flag[i] := true;
end;

critical section

turn := j;
flag[i] := false;

remainder section

until false;

8. Describe a system model for deadlock.


9. Explain RESOURCE ALLOCATION GRAPH algorithm for deadlock avoidance.
10. Discuss deadlock recovery technique.

BCA/ B.Tech(CSE,IT)/ MCA/ B.Sc/ M.Sc Tuition.

You might also like