Deadlocks, Computer Operation System / Architecture If you answered this already
ID: 3821305 • Letter: D
Question
Deadlocks, Computer Operation System / Architecture
If you answered this already, please give alternative version. thanks,
(Q1) Given resource type Xwith two instances, resource type Ywith a single instance, and three threads. As illustrated in there source allocation graph, Thread 0 owns resource type Y's instance and is waiting for resource type X. Thread 1 owns one instance of resource type X. Thread 2 owns the other instance of resource type X and is waiting for resource type Y. Is there any deadlock? Why or why not? Thread 0 owned by Waiting for Resource X Thread 1 Resource Y Owned by Owned by Waiting for Thread 2Explanation / Answer
Sol . As we can see the above diagram there are three threads and two resources . Wheresas thread X with two instances and thread Y with single instances. In this diagram thread 0 is owned by Resource Y where as it is waiting for thread X . In this thread 0 will neaver complete its execution untill unless it will get the resource from X. And resource X is owned by Thread 1 and Thread 2 . In resource X single instance will free not both instances will free . Thread 1 will do the complete execution because it is not waiting for any other resources and after that will leave the 1 instances . So that 1 instances is owned by Thread 0 and then thread 0 will also complete its execution and then leave the resources X and resources Y. And then Thread 2 will not wait for resource Y and thread 2 will also complete its execution so in this way no deadlock will occur.
Deadlocks are a set of blocked processes each holding a resource and waiting to acquire a resource held by another process. Deadlock is a state in which each member of a group of actions, is waiting for some other member to release a lock. Deadlock is a common problem in multiprocessing systems, parallel computing, and distributed systems, where software and hardware locks are used to handle shared resources and implement process synchronization.In an operating system, a deadlock occurs when a process or thread enters a waiting state because a requested system resource is held by another waiting process, which in turn is waiting for another resource held by another waiting process. If a process is unable to change its state indefinitely because the resources requested by it are being used by another waiting process, then the system is said to be in a deadlock.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.