Deadlock
Task: Watch two threads lock each other out
What you are watching
A deadlock between two processors and two devices, drawn as a resource-allocation graph. P1 acquires the printer and P2 acquires the scanner. P1 then requests the scanner, which P2 is holding, and P2 requests the printer, which P1 is holding. The two holdings and the two requests form a cycle, so each processor is waiting for a device the other will never release and neither can continue. This is circular wait, one of the four conditions that must all hold for a deadlock to occur.