The Artima Developer Community
Sponsored Link

Java Buzz Forum
Eric Burke: Java Concurrency By Example

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Weiqi Gao

Posts: 1808
Nickname: weiqigao
Registered: Jun, 2003

Weiqi Gao is a Java programmer.
Eric Burke: Java Concurrency By Example Posted: Mar 9, 2007 8:04 AM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by Weiqi Gao.
Original Post: Eric Burke: Java Concurrency By Example
Feed Title: Weiqi Gao's Weblog
Feed URL: http://www.weiqigao.com/blog/rss.xml
Feed Description: Sharing My Experience...
Latest Java Buzz Posts
Latest Java Buzz Posts by Weiqi Gao
Latest Posts From Weiqi Gao's Weblog

Advertisement

We had an outstanding presentation at the St. Louis JUG yesterday evening. Eric Burke, of the It's Just a Bunch of Stuff That Happens fame, gave a presentation on some of the new Java 5 and 6 concurrency features, through a series of examples. Like in the past, this is another one of those "you have to be there to experience it" presentations.

Here's what I learned from this presentation:

  • The Java Concurrency in Practice book, by Brian Goetz, with Tim Peierls, Joshua Bloch, Joseph Bowbeer, David Holmes, and Doug Lea, is a must read for anyone developing Java applications on a modern Java platform.
  • Have you written something like this
    try {
      Thread.sleep(1000);
    } catch (InterruptedException e) {
      // ignored
    }
    This is completely wrong.
  • i++ is not atomic.
  • The new concurrency utilities package in Java 5 and 6 is very rich. It's worth studying in depth.
  • TimeUnit
  • CopyOnWriteArraySet
  • Use a ThreadFactory to create threads and give them proper names instead of the default "Thread-1", "Thread-2" and register UncaughtExceptionHandler's.
  • Executor, Future
  • Lock, tryLock(), lockInterruptibly()
  • ReadWriteLock
  • BlockingQueue
  • Here's how a thread should be written
    new Thread() {
      public void run() {
        while (!Thread.currentThread().isInterrupted()) {
          // do the work...
        }
      }
    }

At the meta level, I think the lesson is there are so much stuff that's new in Java 5, that it's worth learning it anew.


On a different topic in the post presentation chats, Eric mentioned that the latest Java 6 have many improvements over Java 5. And if you are upgrading from Java 1.4, you might as well skip Java 5 and jump directly to Java 6

Read: Eric Burke: Java Concurrency By Example

Topic: links for 2007-03-06 Previous Topic   Next Topic Topic: links for 2007-03-06 from PeopleOverProcess.com

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use