Workshop: Finding and Solving Java Deadlocks, Wednesday 11 Sep.
Timeslot: 13:00 - 16:40
Instructor: Heinz Kabutz

Session Abstract:

One of the hazards of multi-threaded code is that if we are not careful, we might cause a deadlock in our program.  The simplest of these is the "deadly embrace", where 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 is another class of deadlock that requires us to analyze the stack traces of all the threads.

In this hands-on-lab, we will explain what causes deadlocks and how we can find them.  You will then be given a body of code to test for deadlocks using the techniques learned.

Description:

Java was designed from the start to support multi-threading.  This gave the JVM the power that made it so popular and allowed it to become the top platform in use for many years.  Multi-threading lets us take advantage of the computing resources provided by the underlying hardware.

Threads in Java are allowed to access the same memory space in order to facilitate fast and fine-grained data exchange.  However, in almost all threading implementations, the operating system is allowed to swap out threads in the middle of an operation.  This leads to the possibility of data races.

In order to prevent data races, we use locks such as monitors (synchronized) and owned locks (ReentrantLock).  Unfortunately, when we use more than one lock to protect data, we can cause lock ordering deadlocks, also called a deadly embrace.

In the early days of Java, we had to painstakingly search through many stack traces in order to hopefully find the deadlock.  Later a deadlock detection tool was added to the Java toolset.  This finds simple versions of the deadly embrace, but there are many more deadlocks that we can cause which the tool does not find.

In this hands-on lab, we will start by spending an hour on giving you some tips on how to go about diagnosing and finding deadlocks in your code.  We then present you with a system that has been reported to sometimes cause problems.  Your job will be to analyze the code, find the problem and fix it.

Prerequisites:

Please bring along a laptop with your favourite IDE and JDK 1.7 (at least) installed.  (I will provide a place for them to download the workshop files after registering, but I will do that closer to the time after I've had some chance to prepare them)
Sign in to Google to save your progress. Learn more
Name *
Your full name
Email *
Please use the same e-mail address as your ticket is registred on.
Submit
Clear form
Never submit passwords through Google Forms.
This content is neither created nor endorsed by Google. - Terms of Service - Privacy Policy

Does this form look suspicious? Report