Thanks Frederic. I'm still not clear on whether I can just avoid using ExecutionHandler, run long-running business logic directly in the Netty I/O threads, and rely on using a CachedThreadPool for the Netty I/O threads to ensure that there's going to be available threads for Netty to do its thing. <br>
<br>Also, I was wondering whether there was any problem in submitting a task to my own threadpool from my own handler rather using any ExecutionHandler at all (without caring about event ordering or anything like that). <br>
<br><br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Date: Sun, 18 Oct 2009 00:24:04 -0700 (PDT)<br>
From: Frederic Bregier <<a href="mailto:fredbregier@free.fr">fredbregier@free.fr</a>><br>
Subject: Re: When is ExecutionHandler necessary<br>
To: <a href="mailto:netty-users@lists.jboss.org">netty-users@lists.jboss.org</a><br>
Message-ID: <<a href="mailto:1255850644557-3843469.post@n2.nabble.com">1255850644557-3843469.post@n2.nabble.com</a>><br>
Content-Type: text/plain; charset=us-ascii<br>
<br>
<br>
Hi Dan,<br>
<br>
Take a look at the documentation and specifically the API.<br>
One advantage of the given ExecutionHandler (specifically<br>
OrderedMemoryAwareThreadPoolExecutor) is that message will be kept in order<br>
for one channel. If you don't have any such need (message can arrived in any<br>
order for any channel), then my believe is that you can use your own<br>
ExecutionHandler.<br>
<br>
Cheers,<br>
Frederic<br>
<br>
<br>
Dan D wrote:<br>
><br>
> bump<br>
><br>
> On Thu, Oct 15, 2009 at 11:10 AM, Dan D <<a href="mailto:danotsky@gmail.com">danotsky@gmail.com</a>> wrote:<br>
><br>
>> Below, Trustin mentions using an ExecutionHandler for long-running<br>
>> business<br>
>> logic to prevent tying up Netty's worker threadpool. If a cached thread<br>
>> pool is being used for the worker threads, is this still a problem?<br>
>> Won't<br>
>> the threadpool just expand as necessary if business logic is tying up<br>
>> threads?<br>
>><br>
>> Also is an ExecutionHandler required, or can we just submit work to our<br>
>> own<br>
>> ExecutorService? If ExecutionHandler isn't required, what are the<br>
>> benefits<br>
>> to using one?<br>
>><br>
>> Thanks.<br>
>><br>
>><br>
>><br>
>>> On Tue, Sep 29, 2009 at 3:42 AM, Trustin Lee (???) <<a href="mailto:trustin@gmail.com">trustin@gmail.com</a>><br>
>>> wrote:<br>
>>> > Hi Wade,<br>
>>> ><br>
>>> > If your business logic takes long time, then you should use an<br>
>>> > ExecutionHandler. ?Otherwise, other connections will freeze until the<br>
>>> > long operation finishes. ?If there's no long operation in your<br>
>>> > business logic, you don't usually need an ExecutionHandler in your<br>
>>> > pipeline.<br>
>>> ><br>
>>> > I also suggest to put decoders and encoders before ExecutionHandler<br>
>>> > (if there is one), because decoders and encoders usually do CPU-bound<br>
>>> > jobs.<br>
>>> ><br>
>>> > HTH,<br>
>>> ><br>
>>> > ? Trustin Lee, <a href="http://gleamynode.net/" target="_blank">http://gleamynode.net/</a><br>
>>> ><br>
>>><br>
>><br>
><br>
> _______________________________________________<br>
> netty-users mailing list<br>
> <a href="mailto:netty-users@lists.jboss.org">netty-users@lists.jboss.org</a><br>
> <a href="https://lists.jboss.org/mailman/listinfo/netty-users" target="_blank">https://lists.jboss.org/mailman/listinfo/netty-users</a><br>
><br>
><br>
<br>
<br>
-----<br>
Hardware/Software Architect<br>
--<br>
View this message in context: <a href="http://n2.nabble.com/When-is-ExecutionHandler-necessary-tp3831101p3843469.html" target="_blank">http://n2.nabble.com/When-is-ExecutionHandler-necessary-tp3831101p3843469.html</a><br>
Sent from the Netty User Group mailing list archive at Nabble.com.<br>
<br><br></blockquote></div>