java search
Help improve Java Search

Wednesday, November 22, 2006

Java 5 Concurrency

The last few posts described a few of the new concurrency constructs available from Java 5. The reason for this interest in concurrency in Java, inspite of Java EE recommending only simple threading, is that, there is an increasing availability of multicore and multiprocessor machines. The new architectures move toward having lots of cores but low clock speed per core. This might pose some problems, as Billy Newport discusses in his latest post "Multi-core may be bad for Java". The likely problems are
  • Java likely has a longer path length than languages like C and clock speeds won't help with this.
  • JavaEE promotes a simple threading model for applications
  • Garbage collection remains heavily dependant on clock speed for small pauses.
These problems may push the Java development towards heavy multithreading, and light-weight containers. For more details visit the actual post. The following is a list of posts that were made on this blog covering Concurrency.
  • Java: Handling Interrupts: Describes the nuances of interrupting threads and handling the interrupts in a proper way.
  • New features in Concurrency: An overview of the new concurrency features in Java 5.
  • Executors: ThreadPool: A look at Excutors, and an example of how to use ThreadPoolExecutor.
  • Callable and Future: Description and example of how to use Callable and Future interfaces to return values from threads.
  • Locks
  • Reader-Writer Locks: Description of ReaderWriterLock, with a sample implementation of ReentrantReaderWriterLock
  • Conditions: Description and example of how to use Condition interface to have multiple groups of threads waiting to execute a critical section.
  • Synchronizers: Description of various types of synchronizers availabe in Java 5.
  • Selecting Synchronizer: A brief overview of which Synchronizer to use in which situation.
  • Selecting Locks: A brief overview of which Lock to use in which situation.

No comments:

Post a Comment