Teardown 01 - Mastering ArrayBlockingQueue

Learn to code like a pro by studying how pros code

"Rather use java.util.concurrent than write your own"

Who has not heard this sage advice?

Of course we agree, and follow this advice ourselves. But what if the constructs in java.util.concurrent differ from what we need? Can we write our own? And what can we learn from studying how the java.util.concurrent classes work?

In our Teardown series we study the classes in java.util.concurrent line-by-line. We analyze every for-loop and if statement, asking why the authors wrote it this way. We dissect the concurrency controls, looking at how the authors apply it to the construct.

The first construct we chose to study is the ArrayBlockingQueue. The concurrency controls of this class are one of the easiest to understand. ArrayBlockingQueue has one ReentrantLock with two Conditions notEmpty and notFull. Unfortunately the weakly consistent iterators are somewhat complex. Furthermore, the authors overcomplicated their work by not keeping one space free, like we see in ArrayDeque. This means that when takeIndex==putIndex, the queue is either full or empty.

This mini-course consists of almost 4 hours of detailed instruction of how ArrayBlockingQueue works. Watch it either from start to finish, or jump around between sections as your curiosity is piqued. You will definitely learn something - or your money back!

Java Specialists Certificates

This course is required to obtain the following Java Specialists Certificates:

Your Instructor


Dr Heinz M. Kabutz
Dr Heinz M. Kabutz

Heinz Kabutz is the author of The Java Specialists’ Newsletter, a publication enjoyed by tens of thousands of Java experts in over 150 countries. He has been a Java Champion since 2005.


Course Curriculum


  ArrayBlockingQueue
Available in days
days after you enroll

Frequently Asked Questions


How do I get a EU Reverse Charged VAT invoice?
Please contact us and tell us which course(s) you would like to purchase. Please include your company name, address and EU VAT number. Once we have verified this in VIES, we can issue you an EU VAT invoice for direct payment via bank transfer. Do not purchase the course on Teachable directly. Their EU VAT system does not always work.
How long do I have access to a fully paid course?
How does lifetime access sound? After enrolling, you have unlimited access to this course for as long as you like - across any and all devices you own. Furthermore, if we move to another platform, we will offer you a free transfer of your account for all the courses that you have purchased.
Can I pay via PayPal?
Yes, you can for outright purchases, but not for recurring payments such as paying by installments.
May I share my login details with my colleagues?
Unfortunately not. The terms of usage are for a single license. Teachable tracks your progress through the curriculum, so you won't know how much you have watched. We offer discounts on bulk licenses by one company. Please contact us for bulk licensing.
May we use the course for running in-house courses?
You may, as long as each of the students in the class has a valid license for that course. For example, some companies run lunch time Design Patterns study groups using our material. This is an effective way to learn. Please contact us for bulk licensing.
What if I am unhappy with the course?
We would never want you to be unhappy! If you are unsatisfied with your purchase, contact us in the first 14 days to tell us what you are unhappy about, and we will give you a full refund and deregister you from the course.
Can I watch the course offline during my commute?
Yes, Teachable supports offline viewing on iOS and Android. See Use our iOS and Android Mobile Apps.

Get started now!