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

04 Task Performance PLATECH

This document discusses concurrency and deadlocks. It provides an illustration of a deadlock scenario involving two processes (P and Q) competing for two resources (A and B). It then poses a series of questions to analyze the deadlock scenario and different execution paths. Indirect deadlock prevention methods like hold-and-wait are suggested to avoid the deadlock. The document also discusses how deadlocks relate to the number of processes and resources in a system.

Uploaded by

Mart Arvy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
369 views

04 Task Performance PLATECH

This document discusses concurrency and deadlocks. It provides an illustration of a deadlock scenario involving two processes (P and Q) competing for two resources (A and B). It then poses a series of questions to analyze the deadlock scenario and different execution paths. Indirect deadlock prevention methods like hold-and-wait are suggested to avoid the deadlock. The document also discusses how deadlocks relate to the number of processes and resources in a system.

Uploaded by

Mart Arvy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

IT2105

Task Performance
Concurrency and Deadlocks
Objective(s):

At the end of the exercise, the students should be able to:

▪ Assess the common concurrency mechanisms; and


▪ Analyze the deadlock prevention and avoidance strategies as well as the detection approach.

Instructions:
Analyze the illustrations below. Then, answer the following items. Search for related literature and/or relative
studies that would support your answers. Cite your references accordingly. (55 points)

1. Describe the deadlock scenario illustrated above based on your understanding. (5 points)

In my own understanding this is one of the scenarios of deadlock because based on my analyzation
the 3 and 4 in the illustrated image above are in the same blocks which cause deadlock.

04 Task Performance 1 *Property of STI


Page 1 of 2
IT2105

This is the example of No Deadlocks so that if we compare the image above and to this illustration the
number 3 and 4 are not in the deadlock position

2. What do you think would happen if both Process P and Q need to get the same resource? (5
points)

It causes deadlock which both processes cannot progress, and the resources will be destroyed or
consume after it produce. The categories of this resource fall under the consumable resources.

3. Which concurrency mechanism would you suggest that might prevent the deadlock situation
above? Rationalize your answer. (5 points)

I think the hold and wait, like for example the Process P need to hold at least one resources
until the other process done or release.

4. Define in detail the Execution Paths 2 to 6. (5 items x 3 points)


Example: Execution Path 1 – Process Q acquires Resource B and then Resource A.
Process Q then releases Resource B and A, respectively.
1. Q acquires B and then A and then releases B and A. When P resumes execution, it will be able
to acquire both resources.
2. Q acquires B and then A. P executes and blocks on a request for A. Q releases B and A.When
P resumes execution, it will be able to acquire both resources.
3. Q acquires B and then P acquires A. Deadlock is inevitable, because as execution proceeds, Q
will block on A and P will block on B.
4. P acquires A and then Q acquires B. Deadlock is inevitable, because as execution proceeds, Q
will block on A and P will block on B.
5. P acquires A and then B. Q executes and blocks on a request for B. P releases A and B.When
Q resumes execution, it will be able to acquire both resources.
6. P acquires A and then B and then releases A and B. When Q resumes execution, it will be able
to acquire both resources

04 Task Performance 1 *Property of STI


Page 2 of 2
IT2105

5. Do Execution Paths 3 and 4 encompass the first three conditions for a deadlock to occur?
Explain your answer. (5 points)

Yes, the deadlock occurs in the path 3 and 4 because their execution has on the same block so that its
hard to progress both two.

6. If you are to implement deadlock prevention before the processes above reach the critical
section, would it be an indirect method or a direct method? Why? (5 points)

I would implement or choose the indirect method because it is more flexible than direct method.
Because the direct method possible there are only one condition which is the circular wait, but in the
indirect there are 3 conditions like the mutual exclusion, hold and wait, and No preemption.

7. Which deadlock avoidance approach would you suggest for the given situation above and why?
(5 points)

The deadlock avoidance approach that I would suggest in the situation is the resource allocation denial
this is good for me because it does not grant any other request to process if the allocation of the
resources might lead to deadlock.

8. Would you agree that deadlock is relative to the number of processes and available resources
in an operating system? Why or why not? (5 points)

Yes, because all the deadlocks involve different resources and processes also. So that it involves
conflicting resource.

9. If you are asked to reconstruct the progress diagram above to eliminate the critical section, which
is the deadlock-inevitable region, which aspect(s) or area(s) would you modify? Explain how the
modification eliminates the deadlock. (5 points)

If I reconstruct the progress diagram I would modify the fatal region of the diagram which is which is in
the gray shaded area, For instance, if P doesn't require simultaneously using both resources so that
the two processes take the following form

References: https://www.uobabylon.edu.iq/eprints/publication_3_15281_44

04 Task Performance 1 *Property of STI


Page 3 of 2

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy