Operating System- CS604
Assignment # 3
Spring 2011
Marks: 20
Due Date
Your assignment must be uploaded before or on 20, June 2011
Uploading instructions:
Please view the Assignment Submission Process document provided to you by the Virtual University for uploading assignments.
• Assignment should be in .doc format.
• Save your assignment with your ID (e.g. bx020200786.doc).
• Assignment submission through email is highly discouraged.

Rules for Marking:
It should be clear that your assignment will not get any credit if:
• The assignment is submitted after due date.
• The submitted assignment file is corrupted.
• The assignment is copied.
Note:
Your answer must follow the below given specifications. You will be assigned zero marks if you do not follow these instructions.
• Font style: “Times New Roman”
• Font color: “Black”
• Font size: “12”
• Bold for heading only.
• Font in Italic is not allowed at all.
• No formatting or bullets are allowed to use.

Question # 1:
Suppose that the system distinguishes among four types of resources, (A, B, C and D), the following is an example of how those resources could be distributed. There are five processes that take part in the execution and needed resources. You should find the all possible safe sequences for allocating the given resources.
Maximum Resources Currently Allocated Resources Available System Resources
A B C D A B C D A B C D
P0 8 1 2 3 3 2 0 1 2 2 3 1
P1 5 6 1 4 1 2 1 1
P2 5 2 1 4 2 0 1 2
P3 2 3 5 2 1 1 2 1
P4 9 1 2 5 1 0 0 1


Question # 2:
Consider the following resource-allotment strategy. Requests and releases for resources are permitted at any time. If a request for resources cannot be fulfilled because the resources are not available, then we check any processes that are blocked, waiting for resources. If they have the desired resources, then these resources are taken away from them and are given to the requesting process. The vector of resources for which the process is waiting is increased to include the resources that were taken away.
Assume a system with three resource types and the vector Available initialized to (5, 3, 3). If process P0 asks for (3, 3, 2), it gets them. If P1 asks for (1, 0, 1), it gets them. Then, if P0 asks for (0, 0, 1), it is blocked (resource not available). If P2 now asks for (2, 0, 0), it gets the available one (1, 0, 0) and one that was allocated to P0 (since P0 is blocked). P0’s Allocation vector goes down to (2, 3, 2) and its Need vector goes up to (1, 0, 1).
Answer the following questions:
a. Can indefinite blocking occur? Explain your answer.
b. Can deadlock occur? If you answer “yes”, give an example. If you answer “no,” specify which necessary condition cannot occur.
for solution visit http://ping.fm/OrTMO
0 Responses