0% found this document useful (0 votes)
49 views

Assignment 1

The document contains three questions regarding the banker's algorithm for deadlock avoidance in operating systems. Question 1 provides a resource allocation snapshot and asks to determine if the system is in a safe state. Question 2 provides current resource allocations for three processes and asks if the state is safe and if specific requests can be granted. Question 3 provides another resource allocation matrix and asks to find the need matrix, a safe sequence if it exists, and if a specific request from P4 should be granted immediately.

Uploaded by

Ashish Agarwal
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
49 views

Assignment 1

The document contains three questions regarding the banker's algorithm for deadlock avoidance in operating systems. Question 1 provides a resource allocation snapshot and asks to determine if the system is in a safe state. Question 2 provides current resource allocations for three processes and asks if the state is safe and if specific requests can be granted. Question 3 provides another resource allocation matrix and asks to find the need matrix, a safe sequence if it exists, and if a specific request from P4 should be granted immediately.

Uploaded by

Ashish Agarwal
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 1

Hindustan Institute of Management & Computer Studies, Farah, Mathura

Operating System – (KCA – 203)


Assignment – Deadlock

Q1. Consider the following snapshot of a system:


Process Allocation Max Available
AB C D ABCD AB C D
P0 0012 0012 1520
P1 1000 1750
P2 1354 2356
P3 0632 0652
P4 0014 0656
Answer the following questions using the banker’s algorithm:
a) What is the content of the matrix Need? Is the system in a safe state?
b) If a request from process P1 arrives for (0, 4, 2, 0), can the request be granted immediately?

Q2. An OS contains 3 resource classes. The number of resource units in these classes is 7,7,10 respectively. The
Current resource allocation is shown below:

Allocated Resource Maximum Requirement

R1 R2 R3 R1 R2 R3

P1 2 2 3 3 6 8

P2 2 0 3 4 3 3

P3 1 2 4 3 4 4

a) Is the current allocation state safe?


b) Would the following request be granted in current state
i) Process P1 request (1,1,0)
ii) Process P2 request (0,1,0)
iii) Process P1 request (0,1,0)
Q3. Attempt all of the following:
Process Allocation Max Available

A B C A B C A B C

P0 0 1 0 7 5 3 3 3 2
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
a) Find the Content of Need Matrix?
b) Find the Safe sequence? if exist
c) If P4 request for additional resource (3, 3, 0), should it be granted immediately..

You might also like