|
CS604 ASSIGNMENT NO. 2 SPRING 2022 |
CS604 ASSIGNMENT NO. 2 SPRING 2022 || 100% RIGHT SOLUTION || OPERATING SYSTEM || BY VuTech
Operating System (CS604)
Spring 2022
Assignment # 02
Total marks = 15
Deadline Date
25/08/2022
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 corrupt.
- 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 not sufficient. You are supposed to submit your assignment in Doc or Docx format. Any other formats like scan images, PDF, Zip, Rar, Ppt, and Bmp, etc will not be accepted. OBJECTIVE The objective of this assignment is to provide hands-on experience of: - Resource Allocation Graph
- Deadlock characterization
- Deadlock handling
|
NOTE Assignement No. 2 covers 23-29 lectures. No assignment will be accepted after the due date via email in any case (whether it is the case of load shedding or internet malfunctioning etc.). Hence refrain from uploading assignments in the last hour of the deadline. It is recommended to upload the solution file at least two days before its closing date. If you find any mistake or confusion in the assignment (Question statement), please consult with your instructor before the deadline. After the deadline, no queries will be entertained in this regard. For any query, feel free to email at: CS604@vu.edu.pk |
Question No. 1 05 Marks
The following is a set of four interacting
processes that can access three shared semaphores and execute the statements
S1, S2,S3,S4 sequentially.
semaphore A = 0;
semaphore B = 0;
semaphore C = 0;
P1 P2 P3 P4
... ... ... …
wait(A); wait(B);
wait(C); S4
S1; S2;
S3; signal(C);
signal(A); signal(B);
... ...
...
Write down the possible output sequence
when this set of processes run.
SOLUTION: (PAGE = 112)
OUTPUT SEQUENCE:
Process P4 and
Statement S4
Process P3 and
Statement S3
Process P2 and
Statement S2
Process P1 and
Statement S1
Question No. 02 05 Marks
Suppose a system with 20 tape drives and 5
processes. The current system state is shown in the following table.
Process
|
Max Need
|
Allocated
|
P0
|
11
|
6
|
P1
|
5
|
4
|
P2
|
17
|
3
|
P3
|
15
|
3
|
P4
|
8
|
4
|
Draw the Need Matrix from given process states.
SOLUTION:
Process = Max –
Allocation = Need Matrix (PAGE = 138-139)
Process
|
Need Matrix
|
P0
|
5
|
P1
|
1
|
P2
|
14
|
P3
|
12
|
P4
|
4
|
Question No. 03 05 Marks
You are required
to draw the wait-for graph corresponding to the given Resource
Allocation Graph.
Solution:
(Page = 144-145)
KINDLY, DON’T COPY PASTE
SUBSCRIBE,
SHARE, LIKE AND COMMENTS FOR MORE UPDATES
SEND
WHATSAPP OR E-MAIL FOR ANY QUERY
0325-6644800
kamranhameedvu@gmail.com
The End