A colleague ran into some bugs this morning in Cliff Click’s “High Scale Lib”, specifically in NonblockingHashMap. I mentioned them on Twitter and some people asked me to blog, so here you go.
NBHM is a masterful concurrent Map implementation that allows for a highly concurrent usage, beyond what your more familiar ConcurrentHashMap can [...]

A classic Java concurrency bug that you still see pop up frequently is inconsistent synchronization. The Java Memory Model defines the semantics that a Java programmer can expect in a *properly synchronized program*. The JMM specifies that a write made under synchronization will be visible to a subsequent read under synchronization on the [...]

Background: Poll – #1 – #2 – #3
It’s fortunate that there are lots of ways to screw up concurrency because I’ve still got a lot of these entries left. :) Today’s installment will cover one of the most common exceptions encountered with the collections library.
Collections from JDK 1.4 and earlier all use “fail-fast” iterators. [...]

Background: Poll – #1 – #2
This installment of Java concurrency bugs is a simple thing but one that still shows up too frequently, particularly in those new to concurrency. It is tempting to believe that given a “thread-safe” class that you can use that correctly in all situations. This is not true. [...]

Following up on my previous post, this is the second installment of Java Concurrency Bugs. In this post, we’ll look at bugs that come from synchronizing on the wrong object.
#1: Don’t synchronize on an object you’re changing
[source:java]
synchronized(foo) {
foo = …
}
[/source]
If you do this, then other threads will be synchronizing [...]

Recently I posted a question on Stack Overflow asking for the most common Java concurrency bugs. I’m going to recap and consolidate some of the most popular answers in a series of blog posts. If you’d like to continue adding answers or voting over there, the question is still open.
The #1 voted answer [...]

I’m working on a presentation about the most common Java concurrency bugs. I have a whole bunch of material, but not as much data as I’d like. I started a poll over on StackOverflow to collect the most common Java concurrency problems. If you’d like to vote up ones you’ve seen or [...]

Not sure how many people have seen this story but the Microsoft Zune had a widespread problem where it died if powered up on Dec. 31st and refused to start. Apparently it was a leap year problem in calculating the length of the leap year. Even better, here’s the code in question (starting [...]