[concurrency-interest] overview new features.

Peter Veentjer - Anchor Men p.veentjer at anchormen.nl
Tue Aug 9 17:51:51 EDT 2005


Does anyone have a good overview of the new concurrency features of Java 6? I`m quite interested what is comming next.
 
At the moment I`m happy with the concurrency library (have made some Spring beans so that it can be integrated in Spring better). But there are some parts where the concurrency library could be improved. One of those things would be better control on timeout behaviour of the executorservices. That is why I have created the BlockingExecutor that gives the control.
 
public interface BlockingExecutor {
 /**
  * @param command the command to execute.
  * @throws InterruptedException if the current thread has been interrupted. If that happens,
  *                              the command is not executed.
  * @throws NullPointerException if command is null.
  */
 void put(Runnable command) throws InterruptedException;

 /**
  * Offers a command to this BlockingExecutor.
  *
  * @param command the command to execute.
  * @param timeout how long to wait before giving up, in units of unit
  * @param unit    a TimeUnit determining how to interpret the timeout parameter
  * @return true if successful, or false if the specified waiting time elapses before space is available.
  * @throws InterruptedException if the current thread has been interrupted. If that happens,
  *                              the command is not executed.
  * @throws NullPointerException if command or unit is null.
  */
 boolean offer(Runnable command, long timeout, TimeUnit unit) throws InterruptedException;
}
 
Maybe this would be a nice addition to the concurrency library.
 
And why where the Takeable/Puttable/Channel interfaces/implementations removed? I had to create my own libary based on those interfaces and I think the original code should have made it into java 5. JMS is too heavy... and the removed code was perfect.



More information about the Concurrency-interest mailing list