This preview shows page 1. Sign up to view the full content.
Unformatted text preview: s such that the forbidden regions for the two semaphores overlap. If some execution trajectory happens to reach the deadlock state , then no further progress is possible because the overlapping forbidden regions block progress in every legal direction. In other words, the program is deadlocked because each thread is waiting for the other to do a Î operation that will never occur. The overlapping forbidden regions induce a set of states, called the deadlock region. If a trajectory happens to touch a state in the deadlock region, then deadlock is inevitable. Trajectories can enter deadlock regions, but they can never leave. Deadlock is an especially difﬁcult problem, because it is not always predictable. Some lucky execution trajectories will skirt the deadlock region, while others will be trapped by it. Figure 11.32 shows an example of each. The implications for a programmer are somewhat scary. You might run the same program 1000 times without any problem, but then the next time it deadlocks. Or the program might work ﬁne on one machine but deadlock on another. Worst of all, th...
View Full Document
This note was uploaded on 09/02/2010 for the course ELECTRICAL 360 taught by Professor Schultz during the Spring '10 term at BYU.
- Spring '10
- The American