[concurrency-interest] overview new features.

Tim Peierls tim at peierls.net
Tue Aug 9 23:02:12 EDT 2005


Peter Veentjer - Anchor Men wrote:
> Does anyone have a good overview of the new concurrency features of Java 6?
> I`m quite interested what is comming next.

You can browse the JSR166 maintenance updates docs, see the Concurrency JSR166
Interest Site -- http://gee.cs.oswego.edu/dl/concurrency-interest/index.html
-- for details, particularly

  http://gee.cs.oswego.edu/dl/concurrency-interest/post-tiger.html


>  ... 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 {
>  void put(Runnable command) throws InterruptedException;
>  boolean offer(Runnable command, long timeout, TimeUnit unit) throws InterruptedException;
> }

Do you have a small example that illustrates the use of BlockingExecutor to do 
something that is difficult or impossible to achieve conveniently with the 
standard task execution framework?


> 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.

The method names haven't changed, only the class name.

  Channel -> BlockingQueue
  Takeable -> the take and poll methods of BlockingQueue
  Puttable -> the put and offer methods of BlockingQueue

There are no separate interfaces to describe the puttable side of a 
BlockingQueue from its takeable side, but you can provide simple wrappers to 
achieve the same effect.

--tim



More information about the Concurrency-interest mailing list