So begins Brian Goetz in his monumental
book Java Concurrency in Practice.
Several years before that Professor Doug Lea authored the
java.concurrent.util package to help alleviate some of the difficulty. Doug was the right
man for the job. He was also the author of the seminal book “Concurrent Programming in
Java”, an encyclopedia of concurrent programming design patterns where many of the
components that were to become java.util.concurrent were first introduced.
“Writing correct programs is hard; writing correct concurrent programs is harder. There are simply more things that can go wrong in a concurrent program than in a sequential one.”
Before CPiJ was published, a lot of good
programmers were writing some really bad concurrency code. CPiJ taught us how to remove all
of the complicated concurrency code in our programs and put them into reusable
components.
However some of those constructs come with a learning curve. The
purpose of Java Concurrent Animated is to provide a series of animations that visualize the
functionality of the components in the java.util.concurrent library.
Each animation
features buttons that correspond to the method calls in that component. Each button click
shows how the threads interact in real time. The animations are controlled by the actual
Java concurrent component they are illustrating, so the animation is not only a visual
demonstration, it's also a code sample.
The animations are also packaged as a self-executable Java Archive
(JAR) file and is available for download. It'll serve as a valuable reference for
any Java practitioner.
Please feel free to refer to this site as a reference or as a source
of inspiration, when you are seeking a concurrent architectural decision.
If you’re still using constructs like Thread.start or wait/notify,
check out these animations.
So fly in to the world of Java Concurrent
Animated!
And by all means, if you see any errors or omissions, please let me
know right away by sending an email to vgrazi@gmail.com.