Friday, April 19, 2013

Operating System- CS604 Assignment # 3 Solution Spring 2010



Operating System- CS604
Assignment # 3
Solution
Spring 2010
                                                               Marks: 20
Due Date
Your assignment must be uploaded before or on 13th Jan 2011.
Objective
The objective of this assignment is to familiarize with Deadlocks.

Instructions
Ø  Avoid Plagiarism. No marks will be given in case of cheating or copying from the internet or from other students.
Ø  Submit the assignment through your account on VULMS. No assignment will be accepted through email after the due date.  
Ø  If you have any problem related to assignment, feel free to discuss it by email at cs604@vu.edu.pk

Question # 1:
Consider a system with six processes Pak, Iran, Qatar, Oman, UAE and Dubai and four resource types: A, B, C. and D Resource type A has 14 instances, resource type B has 10 instances, resource type C has 12 instances and D has 16 instances.
A
14
B
10
C
12
D
16





i.
Need
A
B
C
D
6
1
4
2
8
2
3
0
1
2
2
1
5
2
4
1
6
4
0
1
7
1
2
4










ii.
Processes
Max
Allocation
Need
Available
A
B
C
D
A
B
C
D
A
B
C
D
A
B
C
D
Pak
8
2
4
4
2
1
0
2
6
1
4
2
4
2
3
4
Iran
11
4
5
3
3
2
2
3
8
2
3
0




Qatar
2
4
4
3
1
2
2
2
1
2
2
1




Oman
7
3
4
2
2
1
0
1
5
2
4
1




UAE
8
4
3
3
2
0
3
2
6
4
0
1




Dubai
7
3
4
6
0
2
2
2
7
1
2
4




<Qatar>

Processes
Max
Allocation
Need
Available
A
B
C
D
A
B
C
D
A
B
C
D
A
B
C
D
Pak
8
2
4
4
2
1
0
2
6
1
4
2
4
2
3
4
Iran
11
4
5
3
3
2
2
3
8
2
3
0
5
4
5
6
Qatar
2
4
4
3
1
2
2
2
1
2
2
1




Oman
7
3
4
2
2
1
0
1
5
2
4
1




UAE
8
4
3
3
2
0
3
2
6
4
0
1




Dubai
7
3
4
6
0
2
2
2
7
1
2
4




<Qatar, Oman>
Processes
Max
Allocation
Need
Available
A
B
C
D
A
B
C
D
A
B
C
D
A
B
C
D
Pak
8
2
4
4
2
1
0
2
6
1
4
2
4
2
3
4
Iran
11
4
5
3
3
2
2
3
8
2
3
0
5
4
5
6
Qatar
2
4
4
3
1
2
2
2
1
2
2
1
7
5
5
7
Oman
7
3
4
2
2
1
0
1
5
2
4
1




UAE
8
4
3
3
2
0
3
2
6
4
0
1




Dubai
7
3
4
6
0
2
2
2
7
1
2
4





<Qatar, Oman, UAE>

Processes
Max
Allocation
Need
Available
A
B
C
D
A
B
C
D
A
B
C
D
A
B
C
D
Pak
8
2
4
4
2
1
0
2
6
1
4
2
4
2
3
4
Iran
11
4
5
3
3
2
2
3
8
2
3
0
5
4
5
6
Qatar
2
4
4
3
1
2
2
2
1
2
2
1
7
5
5
7
Oman
7
3
4
2
2
1
0
1
5
2
4
1
9
5
8
9
UAE
8
4
3
3
2
0
3
2
6
4
0
1




Dubai
7
3
4
6
0
2
2
2
7
1
2
4






<Qatar, Oman, UAE, Dubai >

Processes
Max
Allocation
Need
Available
A
B
C
D
A
B
C
D
A
B
C
D
A
B
C
D
Pak
8
2
4
4
2
1
0
2
6
1
4
2
4
2
3
4
Iran
11
4
5
3
3
2
2
3
8
2
3
0
5
4
5
6
Qatar
2
4
4
3
1
2
2
2
1
2
2
1
7
5
5
7
Oman
7
3
4
2
2
1
0
1
5
2
4
1
9
5
8
9
UAE
8
4
3
3
2
0
3
2
6
4
0
1
9
7
10
11
Dubai
7
3
4
6
0
2
2
2
7
1
2
4




<Qatar, Oman, UAE, Dubai, Pak >
Processes
Max
Allocation
Need
Available
A
B
C
D
A
B
C
D
A
B
C
D
A
B
C
D
Pak
8
2
4
4
2
1
0
2
6
1
4
2
4
2
3
4
Iran
11
4
5
3
3
2
2
3
8
2
3
0
5
4
5
6
Qatar
2
4
4
3
1
2
2
2
1
2
2
1
7
5
5
7
Oman
7
3
4
2
2
1
0
1
5
2
4
1
9
5
8
9
UAE
8
4
3
3
2
0
3
2
6
4
0
1
9
7
10
11
Dubai
7
3
4
6
0
2
2
2
7
1
2
4
11
8
10
13
<Qatar, Oman, UAE, Dubai, Pak, Iran >

No comments:

Post a Comment