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

Spring 2024 - CS604 - 2

Uploaded by

Haris khan
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views

Spring 2024 - CS604 - 2

Uploaded by

Haris khan
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Operating Systems (CS604) Total marks = 20

Assignment # 02 Deadline
June 24, 2024
Spring 2024

Please carefully read the following instructions before attempting the assignment.

RULES FOR MARKING


It should be clear that your assignment would not get any credit if:
 The assignment is submitted after the due date.
 The submitted assignment does not open, or the file is corrupted.
 Strict action will be taken if the submitted solution is copied from any other student or the
internet.

You should consult the recommended books to clarify your concepts, as handouts are insufficient.
You are supposed to submit your assignment in Doc or Docx format.
Any other formats like scanned images, PDF, ZIP, RAR, PPT, BMP, etc. will not be accepted.

Topic Covered:
 Banker’s Algorithm/Safety Algorithm
 Resource Allocation
 Deadlock Avoiding

Topic Covered
Lecture 12 to Lecture 31

NOTE

No assignment will be accepted via email after the due date (whether it is load shedding, internet
malfunctioning, etc.). Hence, refrain from uploading assignments within the last hour of the deadline. It is
recommended that the solution be uploaded at least two days before its closing date.

If you find any mistakes or confusion in the assignment (Question statement), please consult your instructor
before the deadline. After the deadline, no queries will be entertained in this regard.

For any query, feel free to email me at:


[email protected]
Question Statement 20 marks
Consider a system with three processes (P0, P1, P2) and three resource types (A, B, C). The system is described by the
following data:

Total Resources:
A B C
7 2 3

Allocation Matrix
A B C
P0 0 1 0
P1 2 0 1
P2 3 0 2

Maximum Demand (Max) Matrix:


A B C
P0 6 1 2
P1 3 1 2
P2 5 0 2

Solve the below parts using Banker’s Algorithm (Safety Algorithm).


Part 1:
1. Calculate the initial available resources.
2. Calculate the Need matrix.

Part 2:
Determine if the current system state is safe or not?
 If it is safe, provide the unique safe sequence.
 If it is not, then justify your answer.

The End

You might also like