This post originated from an RSS feed registered with Java Buzz
by Avery Regier.
Original Post: Notes from JavaOne Day 4: Concurrency Utilities
Feed Title: cAVEman's Musings
Feed URL: http://sedoparking.com/search/registrar.php?domain=®istrar=sedopark
Feed Description: Musings of Avery Regier on the subject of Java, DevWiki, J2EE, Java operating systems, and whatever else strikes my fancy.
The Concurrency Utilities talk was done again today. Someone was finally able to impress upon the conference organizers that it was needed. It wasn't presented by Doug Lea, but rather by Brian Goetz, another member of the Expert Group. He did a really good job. A team member told me he thought this was the best session of JavaOne this year. Well organized, well presented, and well put together with just the right amount of well-colorized code.
All of these APIs are much cleaner than they were in last year's talk. Everything is also much faster, because none of them use the synchronized keyword, but rather they use JVM internal monitors.
They've got replacements for my current BlockingQueue implementations. These are so useful it is amazing. We've used them a lot to increase the user's perceived response time and to utilize server resources well within our applications. Their implementations have separated non-bocking get() from blocking get() (as a take() method). I think this is a win.
We also get read/write locks and the ability to fail on trying to retrieve a lock. I'm really looking forward to easy to use read/write locks. I remember writing List implementations in C++ in college that were highly concurrent using these and I've wanted to use these ever since. Up til now, I just haven't had the tools in Java. Well, I guess I still won't have the tools for another year and half at least, because all of this won't get released until 1.5.
One of his big points was to use the Executor instead of new Thread(new Runnable()).start();. It has nice things like sudden and soft closing of thread pools.