Skip to main content

When the World is Running Down

Posted by editor on June 28, 2007 at 4:14 AM PDT

Finding and fixing bugs in heavily concurrent code

A strong understanding of concurrency and threading is one of the traits that distinguishes the best Java developers, in every permutation of the platform. Servers by their very nature are heavily multi-threaded, good desktop developers know to thread off expensive work and unblock AWT-Event-Dispatch, and ME developers often have to carefully manage threads and other resources in order to coexist with other apps in the same small VM.

The concurrency utilities introduced in Java 5.0 offer various ways to achieve high efficiency with threads. For example, the ReadWriteLock interface and ReentrantReadWriteLock class give you a convenient means of providing concurrent read-many, write-once access to some resource.

It also provides some means of thoroughly messing up your application. What if you forget to unlock? Or what if you have a read lock and you try to perform a write operation? These mistakes can create subtle, hard-to-fix bugs.

Fortunately, there's help in today's Feature Article, Ran Kornfeld's Extending the ReentrantReadWriteLock

This article was not written just to tell you about these pitfalls and send you on your way, but also to introduce a solution, which comes as an extension to the ReentrantReadWriteLock class. This extension (actually a composition) will wrap the lock and add more capabilities to help you overcome the specified problems.

In Java Today,
the Filthy Rich Clients project hosts sample code for the upcoming book of the same name by Chet Haase and Romain Guy. On his blog, Romain recently announced the availability of demos for chapters 5 (Performance) and 6 (Composites). Ultimately, the project will host the complete collection of demos and examples found in the book

The blog has published an interview with Mobile & Embedded Community Leader Roger Brinkley. "Roger and I had a chance to visit recently and talk more about his involvement in leading the community. Read on to learn a little more about what goes on behind the scenes in this thriving community..."

In an opinion piece on JavaLobby, Clemens Eisserer asks Why Doesn't Google Bet On Java? "Google is well-known for doing almost everything possible using Javascript and to have a lot of knowledge in this area. Sometimes this works very well (like for GMail) and sometimes not (like for docs & spreadsheets). [...] But why? Its like building a school-bus with a motorcycle engine just because these engines are there. "

Today's Weblogs section starts with some
Quick feedback from Jazoon by Fabrizio