Java Reference
In-Depth Information
You may think we're overstating the risk of deadlock because locks are usually held only
briefly, but deadlocks are a serious problem in real systems. A production application may
perform billions of lock acquire-release cycles per day. Only one of those needs to be timed
just wrong to bring the application to deadlock, and even a thorough load-testing regimen
may not disclose all latent deadlocks. [1] DemonstrateDeadlock in Listing 10.4 [2] dead-
locks fairly quickly on most systems.
Listing 10.4. Driver Loop that Induces Deadlock Under Typical Conditions.
Search WWH ::




Custom Search