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

PT Platform

This document discusses deadlocks and concurrency mechanisms. It presents a scenario where processes P and Q each request resources A and B, leading to a deadlock situation. The document then poses a series of questions to analyze deadlock conditions and prevention strategies. It discusses indirect prevention methods, circular wait approaches, and modifications that could be made to the sample diagram to eliminate the critical region and deadlock.

Uploaded by

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

PT Platform

This document discusses deadlocks and concurrency mechanisms. It presents a scenario where processes P and Q each request resources A and B, leading to a deadlock situation. The document then poses a series of questions to analyze deadlock conditions and prevention strategies. It discusses indirect prevention methods, circular wait approaches, and modifications that could be made to the sample diagram to eliminate the critical region and deadlock.

Uploaded by

luis mulas
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, 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 this deadlock, two processes, P and Q, struggle for resources A and B. Only one process at
a time may access a given resource. Unlike Process Q, which obtains and holds onto
- Process P obtains and retains Resource B while Resource A waits for Resource B to arrive.
2. What do you think would happen if both Process P and Q need to get the same resource? (5
points) - After resource units are acquired, they are made available for usage by other
operations. I/O channels, CPUs, main and secondary memory, hardware, and data structures like

04 Task Performance 1 *Property of STI


Page 1 of 3
IT2105

files, databases, and semaphores are examples of reusable resources. There will be starvation and
a standoff since neither side can use the resource at the same time.

3. Which concurrency mechanism would you suggest that might prevent the deadlock situation above?
Rationalize your answer. (5 points)
- - Circular wait: This guarantees that no cycle will form and that no process can request a
resource that is being used by another process. Violation of the circular wait is the sole strategy that
can be used in real-world situations. To avoid a deadlock, one could begin by devising a strategy
that gets rid of one of the prerequisites (conditions 1 through 4). Second, by taking the right
measure, impasse can be avoided. Third, if conditions 1 through 4 are met, one could attempt to
ascertain whether a stalemate is present and take appropriate action to break free. We address each
of these strategies independently, making adaptive decisions based on the allocation of resources.
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.
- Process Q acquires Resource B, releases Resource B, and then acquires Resource A, whereas
Process P acquires Resource A
- As opposed to Process P, Process Q receives Resource B. Deadlock happens when resource A,
which Process Q needs to move forward, is used by Process P.
- While Process Q receives resource B, Process P receives resource A. Process Q uses resource B,
which Process P needs to continue, causing a deadlock.
- While Process Q is running and P is waiting, Process P uses resources A and B. Then, Process P
discharges A and B.
- While Q waits, process P uses resources A and B before releasing each one in turn.

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

- - To avoid a deadlock, one could begin by devising a strategy that gets rid of one of the
prerequisites (conditions 1 through 4). Second, by taking the right measure, impasse can be
avoided. Third, if conditions 1 through 4 are met, one could attempt to ascertain whether a
stalemate is present and take appropriate action to break free. We address each of these strategies
independently, making adaptive decisions based on the allocation of resources.If you are to
implement deadlock prevention before the processes above reach the critical section, would it be
an indirect method or an indirect method? Why? (5 points)
- Indirect approach would be preferable since it is more effective and has a wider range than the
direct strategy, and because I could avoid even one stalemate. Implementing indirect is easier than
focusing on eliminating cyclic and waiting by devoting each resource to a specific task.

6. Which deadlock avoidance approach would you suggest for the given situation above and why? (5
points)
- Circular wait: This guarantees that no cycle will form and that no process can request a resource
that is being used by another process. Violation of the circular wait is the sole strategy that can be
used in real-world situations.

7. 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)

04 Task Performance 1 *Property of STI


Page 2 of 3
IT2105

- Deadlock happens when a group of processes is permanently stopped because each process has
obtained a portion of the resources required for completion and is waiting for the release of the
remaining resources, which are being held by other processes in the same group.
8. 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)
- In order to remove the deadlocks in the diagram, I would make changes where there is a crucial
part or mistake. Adaptive assessments based on the current distribution of resources We address
each of these strategies individually. Grading Rubric for Essay:
Criteria Performance Indicator Points
Content Correct ideas, concepts, and/or examples were included. 3
Organization The ideas were presented in an organized manner. 2
TOTAL 5

Note: DO NOT COPY AND PASTE. Students who copy and paste their work from any website or their classmates will automatically receive a failing mark for this assessment task.

04 Task Performance 1 *Property of STI


Page 3 of 3

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