[concurrency-interest] overview new features -> tim.

Peter Veentjer - Anchor Men p.veentjer at anchormen.nl
Mon Sep 5 14:35:41 EDT 2005


Sorry for this late reply tim. 

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

I`m currently working on a channels project, and I need the control on timeout behaviour of 

the tasks in the BlockingExecutor. I don`t have the control to do a put/offer and send

timeout parameters with the current Executors (there is only a single execute method

with no arguments) and that is what I need.


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

I don`t think that is a very good solution because the exchange of messages is combined 

with storage of messages. 

You can see my channels project here:

http://members.home.nl/peter-veentjer01/index.htm

I want to have total control and don`t want to drag along a lot of garbage.

And sorry for this messy reply. My Email client (outlook) doesn`t make a good 

reply and is terrible for layout.

 




More information about the Concurrency-interest mailing list