TP CD Gallato JM

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

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)
The deadlock scenario illustrated P and Q is same resource to get that is why P and Q waiting
each other who is the first process in resource A and B and threads are blocked forever, waiting
for each other.
2. What do you think would happen if both Process P and Q need to get the same resource? (5
points)
If both process P and Q to get same resources if the two first process in same resources for
example if you buy a food or something but there is one who first to buy in same market you
should wait after buys it and you next to buy in system is same who is the first process to get
same resource the process or a thread first to get resources not allowed together the two
processes to get same resource because the system are corrupted or debugging if the process
together process to get same resources so will be broken your system or causing debugging first
come first serve that’s the process to get same resources after finish should next to get
resources that’s all.
3. Which concurrency mechanism would you suggest that might prevent the deadlock situation
above? Rationalize your answer. (5 points)
I suggest counting semaphore in concurrency mechanism because The synchronization
mechanisms known as counting semaphores have values between 0 and n, where n is a non-
negative integer greater than one (1). This method of counting semaphores can make several
access tokens to a crucial component available for example if the process P go to the guard that
is we Process C so P ask C how to process and C will teach after demo P will be process to get
resources that might prevent the deadlock situation in the processing resources that’s all.
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
So Execution Path 2 to 6 define as a waiting process as you see in the illustration that arrows in
the inside are called waiting area or are the Paths for example if you a process a documents
while you apply you many department you go and compile the files you need after you apply
jobs and interview after you passed you have if not you find another jobs and system goes same
process in real life situation many process in the path so path 2 will go to other process to get
resource A and if not path 3 will go to path 4 will go same process until 6 and until it gets the
resources of Process Q so paths is waiting who is the priority first process if not other paths
process same process like messenger if you open multiple reply in the messenger so who is your
priority first open chats in depends on the user that’s the process also if the signal is ready who
is the path first to process to first get the resources and system knows who is close in the
process so the path2 will first process in the process Q because path2 is the closed in process Q
so first process to get resources that’s all.
5. Do Execution Paths 3 and 4 encompass the first three conditions for a deadlock to occur?
Explain your answer. (5 points)
Deadlock can only happen if all four conditions are met, starting with the mutual exclusion
condition. A particular resource can only be used by one process at once. The process must wait
until the first process releases the resource before making a request for it. Hold and Wait
Situation 2. Processes still running
6. 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)
It would be indirect method because for protecting critical sections and establishing
synchronization between tasks to prevent together process same time to implementing
deadlock prevention in critical section that’s all.
7. Which deadlock avoidance approach would you suggest for the given situation above and why?
(5 points)
The operating system uses the deadlock Avoidance method to determine if the system is in a
safe state or an unsafe state. In order to avoid deadlocks, the process must inform the operating
system of the maximum number of resources it will need to request in order to complete its
execution. So for example deadlock avoidance is anti virus application it is used deadlock
avoidance if the thread of application or file is to determine if is safe or unsafe to complete
execution other example is notify if you download crack files it will appear a warning if the
resources is unsafe if you download the system signal the antivirus so antivirus will process the
file if the file if there is a virus or causing deadlock to prevent harmful events in the system
that’s all.
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)
I agree that the deadlock is relative to the number of process because system one by one
process and the process race who is the first to get resources and others will be waiting and
causing deadlock are same process same resources process to waiting each other who is the first
but it will be race if the process and available resources will be race process first come first serve
and you used common sense to used computer to avoid deadlock and you should what you
doing in your system if not it might be causing trouble to your unit don’t be together process at
a same time can cause deadlock or can logging or debug your system that’s all.
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)
I reconstruct is line 4 or path 4 why because line 3 are same in the area deadlock inevitable
process I want 4 will be out of that area will be creating as guideline processes a line 4 is the
gateway to process to get resources all the paths and process will go on the path4 to be
organized process and not be crumbled processes so that that the process will fluent process
and not causing deadlocks while you process that’s all.

You might also like