One of the hazards of multithreaded code is that if we are not careful, we might cause a deadlock in our program. The simplest of these is the “deadly embrace,” in which locks are acquired by multiple threads in different orders. The simple deadlocks can be detected automatically with the deadlock detection tool in the ThreadMXBean. However, there are also other types of deadlocks that cannot be detected automatically and that require analysis of the stack traces of all the threads, just as in the good old days.
This hands-on-lab explains what causes deadlocks and how to find them. You will then be given a body of code to test for deadlocks, using the techniques learned.
Heinz is the mastermind behind The Java Specialists' Newsletter. He has a PhD in Computer Science. Heinz has programmed significant portions of several large Java applications and has taught Java to thousands of professional programmers. He is a regular speaker at all the major Java conferences. Heinz was chosen as a Java Champion by Sun Microsystems, the inventors of Java, for his work in advancing Java. Heinz presents our Java training courses anywhere in the world, either in person or via remote teaching technologies. He is the author of all our courses, including Java Specialist Master, Design Patterns and Concurrency Specialist Courses.
More About Heinz »