-
Book Overview & Buying
-
Table Of Contents
Mastering Parallel Programming with R
By :
Deadlock is a classic problem that affects parallel code built on explicit message passing. It arises when a process or thread of execution waits to receive a message that is never sent or to send a message but the intended recipient isn't listening and never will be.
In computing, deadlock as a concept arose from the context where a number of agents compete for mutually exclusive access to a shared resource—for example, a portion of memory representing a value that is to be updated via a locking mechanism that singularizes access to the resource; think simultaneous ATM transactions applied to a shared bank account. In this case, if the lock is not freed by the previous agent, then no other agent can gain access to the lock and may be queued indefinitely.
A classic deadlock scenario is where Agent A has gained access to resource 1, Agent B has gained access to resource 2, Agent A is waiting to gain access to resource 2 (which B now exclusively holds), and likewise, Agent...