Hi Samiyuru,

Do you need to do  blocking operations inside EventHandler threads ? If so
we can add that functionality in future release

thanks

On Wed, Feb 24, 2016 at 10:35 AM, Samiyuru Senarathne <samiy...@wso2.com>
wrote:

> Hi Isuru,
>
> So what is the a way to have a worker pool [1]?
>
> [1] -
> https://lmax-exchange.github.io/disruptor/docs/com/lmax/disruptor/dsl/Disruptor.html#handleEventsWithWorkerPool(com.lmax.disruptor.WorkHandler...)
>
> Best Regards,
> Samiyuru
>
>
> On Tue, Feb 23, 2016 at 10:30 AM, Isuru Ranawaka <isu...@wso2.com> wrote:
>
>> Hi samiyuru,
>>
>> According to the Disruptor architecture it is written such that to
>> minimize thread switching .If we define high number of  threads in Executor
>> Service  than no of EventHandlers then it will only pick
>> threads equal to EventHandlers.If particular  thread blocked then that
>> EventHandler also get blocked. So due to this reason we should not do any
>> blocking operation inside Disruptor Handlers.So particular EventHandler is
>> always bound to particular thread in ExceutorService for EventHandler life
>> time.So I think configuring threads on Executor service  may not have
>> significant improvement.
>>
>> thanks
>> IsuruR
>>
>>
>> On Tue, Feb 23, 2016 at 10:04 AM, Samiyuru Senarathne <samiy...@wso2.com>
>> wrote:
>>
>>> Hi Shafreen,
>>>
>>> Yeah, the threads in this ExecutorService will be used to execute the
>>> EventHandler. So, according to the current implementation for one handler
>>> there will be only one thread right?
>>>
>>> In this case, events cannot be processed concurrently. Events will be
>>> processed one after another sequentially. Therefore, I think we should have
>>> a way to specify the number of event handlers and the number of threads in
>>> the  ExecutorService separately.
>>>
>>> Best Regards,
>>> Samiyuru
>>>
>>> On Tue, Feb 23, 2016 at 9:24 AM, Shafreen Anfar <shafr...@wso2.com>
>>> wrote:
>>>
>>>> Hi Samiyuru,
>>>>
>>>> AFAIU, for each Disruptor we create an ExecuterService. Threads in this
>>>> ExecutorService will be used to execute the EventHandler of the Disruptor.
>>>> Therefore, number of threads in the Executor are the number of
>>>> EventHanlders for that particular Disruptor.
>>>>
>>>> @IsuruR - please correct me if I am wrong :)
>>>>
>>>> On Fri, Feb 19, 2016 at 10:34 AM, Samiyuru Senarathne <
>>>> samiy...@wso2.com> wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> In carbon-transport, why are the number of event handlers and the
>>>>> number of threads in the ExecutorService of Disruptor [1] the same? Is
>>>>> there a way to configure them separately?
>>>>>
>>>>> [1] -
>>>>> https://github.com/wso2/carbon-transports/blob/master/http/netty/components/org.wso2.carbon.transport.http.netty/src/main/java/org/wso2/carbon/transport/http/netty/common/disruptor/config/DisruptorFactory.java#L47
>>>>>
>>>>> Best Regards,
>>>>> Samiyuru
>>>>>
>>>>> --
>>>>> Samiyuru Senarathne
>>>>> *Software Engineer*
>>>>> Mobile : +94 (0) 71 134 6087
>>>>> samiy...@wso2.com
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Regards,
>>>> *Shafreen*
>>>> Software Engineer
>>>> WSO2 Inc
>>>> Mobile : 077-556-395-1
>>>>
>>>
>>>
>>>
>>> --
>>> Samiyuru Senarathne
>>> *Software Engineer*
>>> Mobile : +94 (0) 71 134 6087
>>> samiy...@wso2.com
>>>
>>
>>
>>
>> --
>> Best Regards
>> Isuru Ranawaka
>> M: +94714629880
>> Blog : http://isurur.blogspot.com/
>>
>
>
>
> --
> Samiyuru Senarathne
> *Software Engineer*
> Mobile : +94 (0) 71 134 6087
> samiy...@wso2.com
>



-- 
Best Regards
Isuru Ranawaka
M: +94714629880
Blog : http://isurur.blogspot.com/
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to