mina-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emmanuel Lecharny <elecha...@gmail.com>
Subject Re: ExecutorFilter quick poll: How do you use it ?
Date Tue, 04 Nov 2008 17:03:21 GMT
Ashish wrote:
>
>> 2) Where in the chain do you put this filter ?
>>     
>
> Multiple places to implement SEDA (before ProtocolDecoder, before IoHandler)
>   
I would like to know if you are not ask risk to have a hell lot of 
thread if you do so. And I'm not sure that it has any added value, as 
the idea is to use a thread to handle a costly operation, no need to 
spawn a new thread when it's already done... Am I missing something ?
>
>> 4) Is this a problem if the chain is not protected when using an
>> ExecutorFilter ?
>>
>>     
>
> Not sure if I can comment on this, but does this mean same byte chunk
> (IoBuffer) can be processed by more than one thread?
> If it can be, I have flow in my implementation :-(
>   
That's for sure, unless you have already gathered all the bytes before 
processing the created message in its own thread (via the Executor). The 
idea is pretty much to collect the bytes until you can build a new 
Object, and then spawn a thread passing this object to it. Otherwise, 
assuming that the bytes arrive by chunk, which thread will swallow the 
next incoming bytes ?

-- 
--
cordialement, regards,
Emmanuel L├ęcharny
www.iktek.com
directory.apache.org



Mime
View raw message