Comments on: Asynchronous processing in Java applications – leveraging those multi-cores https://technology.amis.nl/2009/02/19/asynchronous-processing-in-java-applications-leveraging-those-multi-cores/ Friends of Oracle and Java Sat, 01 Aug 2015 11:10:05 +0000 hourly 1 http://wordpress.org/?v=4.2.3 By: Abel https://technology.amis.nl/2009/02/19/asynchronous-processing-in-java-applications-leveraging-those-multi-cores/#comment-5713 Thu, 23 Feb 2012 14:34:00 +0000 http://technology.amis.nl/blog/?p=4859#comment-5713 Fantastic article. I have been getting stumped on async execution and always wondered how best to do it. This will atelast give me a very good guide on how to implement it.

]]>
By: AruKris https://technology.amis.nl/2009/02/19/asynchronous-processing-in-java-applications-leveraging-those-multi-cores/#comment-5712 Fri, 17 Feb 2012 06:39:12 +0000 http://technology.amis.nl/blog/?p=4859#comment-5712 Excellent, well written article on Executors . Thanks & Thanks.

]]>
By: Quidam7 https://technology.amis.nl/2009/02/19/asynchronous-processing-in-java-applications-leveraging-those-multi-cores/#comment-5711 Fri, 20 Jan 2012 20:45:40 +0000 http://technology.amis.nl/blog/?p=4859#comment-5711 Clear and educationalist. Thanks a lot for sharing this !

]]>
By: ecomba https://technology.amis.nl/2009/02/19/asynchronous-processing-in-java-applications-leveraging-those-multi-cores/#comment-5710 Sat, 07 Jan 2012 22:18:40 +0000 http://technology.amis.nl/blog/?p=4859#comment-5710 Very interesting and very well written article. Thanks a lot!

]]>
By: swaroop https://technology.amis.nl/2009/02/19/asynchronous-processing-in-java-applications-leveraging-those-multi-cores/#comment-5709 Sat, 17 Dec 2011 18:30:17 +0000 http://technology.amis.nl/blog/?p=4859#comment-5709 Very well drafted article…..

]]>
By: Shachi https://technology.amis.nl/2009/02/19/asynchronous-processing-in-java-applications-leveraging-those-multi-cores/#comment-5708 Tue, 13 Dec 2011 10:52:56 +0000 http://technology.amis.nl/blog/?p=4859#comment-5708 Very well explained …

]]>
By: Joboski https://technology.amis.nl/2009/02/19/asynchronous-processing-in-java-applications-leveraging-those-multi-cores/#comment-5707 Sun, 27 Nov 2011 12:46:29 +0000 http://technology.amis.nl/blog/?p=4859#comment-5707 Superb article!!

]]>
By: Sanjay https://technology.amis.nl/2009/02/19/asynchronous-processing-in-java-applications-leveraging-those-multi-cores/#comment-5706 Tue, 19 Jan 2010 12:20:44 +0000 http://technology.amis.nl/blog/?p=4859#comment-5706 Very good explaination..Very well written article..

]]>
By: Bill https://technology.amis.nl/2009/02/19/asynchronous-processing-in-java-applications-leveraging-those-multi-cores/#comment-5705 Tue, 19 May 2009 21:28:43 +0000 http://technology.amis.nl/blog/?p=4859#comment-5705 It’s a pretty clear article. I especially appreciate the example code to show callbacks vs ExecutorCompletionService – I had assumed I must be missing something since callbacks are obviously part of a fully asynchronous request/response, but are not discussed in java.util.concurrent. Future is ok, but with get() and take() it seems to be only 1-way async. The JSR 166 group apparently considered the issue but did not include callbacks (http://osdir.com/ml/java.jsr.166-concurrency/2002-09/msg00068.html).

Another way to use util.concurrent 2-way async without callbacks would be to have an executor run a “request service” and also run a second queue back to a “response handling service.” That way you get the benefit of queueing, and you can free up the “request service” threads a little sooner. But callbacks will work well in many situations where response handling is fast (setting values or using in-memory data structures). The javadocs for javax.xml.ws.Service hint that Service may use this strategy.

One suggestion: change the formatting a little – there are some long lines with “2 lines of code” on them. I was initially confused because I was reading with a large font size, and the 2nd line (very important code) was invisible off to the right of the text box.

This is the line that clued me in to the problem, since I originally did not see “cs” defined:

ExecutorService es = Executors.newFixedThreadPool(3); CompletionService cs = new ExecutorCompletionService(es);

]]>
By: Josef https://technology.amis.nl/2009/02/19/asynchronous-processing-in-java-applications-leveraging-those-multi-cores/#comment-5704 Sat, 28 Feb 2009 14:16:39 +0000 http://technology.amis.nl/blog/?p=4859#comment-5704 Very well done article. One of the best I have seen explaining the concepts. Thanks.

]]>