Assignment 3
Assignment 3
(1) Define the term Deadlock. Under what condition does a Deadlock occur? Explain them.
(2) Write four necessary conditions for deadlock.
(3) What constitute a state of a system? What is a safe state? Describe an algorithm to check
whether a given state is safe or not?
(4) Consider the following snapshot of a system-
Allocation Max
Process
A B C A B C
P0 0 1 0 7 5 3
P1 2 0 0 3 2 2
P2 3 0 2 9 0 2
P3 2 1 1 2 2 2
P4 0 0 2 4 3 3
Let the available number of resources be given by avail vector as (3, 3, 2). Use banker’s
algorithm and answer
1. Find the contents of the matrix “NEED”
2. Is the system in a safe –state?
3. If a request from process P4 for (3, 3, 0) arrives, can it be granted immediately?
(5) Write short note on-Deadlock Recovery
(6) Is it possible to have a deadlock involving only one single process? Explain your
answer.
(7) A disk with 1000 cylinders, numbered 0 to 999, compute the number of tracks the disk
arms must move to satisfy the entire request in the disk queue. Assume the last request
serviced was at track 345 and head is moving towards track 0. The queue in FIFO order
contains request for the following tracks:
123,874,692,475,105,376
Perform the computation for the following scheduling algorithm-
(1) FIFO (2) SSTF (3) SCAN 4) C-SCAN 5) LOOK 6) C-LOOK