1. Describe the deadlock scenario illustrated above based on your understanding.
Answer: The deadlock is executed whenever the first process and the second process lock the first and second resources in an instance/ the same time. 2. What do you think would happen if both Process P and Q need to get the same resource? Answer: It will be in a Deadlock, it is either not be able to get the resource and force stops the process and restart or the later process will have to wait for the first process to be finished in collecting the needed resources. 3. Which concurrency mechanism would you suggest that prevent the deadlock situation above? Rationalize your answer. Answer: I suggest the Deadlock prevention. It works by preventing one of the 4 (4) Coffman conditions from occurring. It will prevent the process to get into deadlock and get the resource it needs by letting the first process to collect the needed resources and letting the next process to wait until the first process is done. 4. Define in detail the Execution Path 2 to 6 Answer: *Execution Path 2: - Process Q gets the Resource B then Resource A. - Process Q then release only Resource A. *Execution Path 3: - Process Q gets Resource B and faced a deadlock. *Execution Path 4: - Process P gets the Resource A and faced a deadlock. *Execution Path 5: - Process P gets the Resource A, then gets Resource B after getting Resource A. - Process P then release only Resource B. *Execution Path 6: - Process P gets the Resource A, then gets Resource B after getting Resource A. - Process P then release Resource A and B respectively. 5. Do Path 3 and 4 encompass the first three conditions for a deadlock to occur? Explain your answer. Answer: No, because Process Q is dedicated only for the Resource B, while Process P is dedicated for the Resource A which is very different from the Process Q. 6. If you are to implement deadlock prevention before the processes above reach the critical section, would it be direct method or an indirect method? Why? Answer: I would prefer to choose the Indirect method. Because the process needs different types of resources, the next to the first process needs to stop and must wait for the first process to be finished in collecting the essential resources. 7. Which deadlock avoidance approach is relative to the number of processes and available resources in an operating system? Why or why not? Answer: For me, Process initiation denial is relative to the number of processes and available resources in an operating system. It is because it would suppose that it will not get the needed resources because it will be in a deadlock. 8. Would you agree that deadlock is a relative to the number of processes and available resources in an operating system? Why or why not? Answer: For me, its yes. Because deadlock is a situation where sets of processes are blocked because each process is holding a resource and waiting for another resource acquired by other processes. 9. If you are asked to reconstruct a program 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 eliminate the deadlock. Answer: For me, I will try to change the area processes needs to get their needed resources. I will change the place of the resources to be directly placed to the process where they are needed. I’ll replace the Path 2 and path 5 with path 3 and 4, so that deadlock will not occur.