[jboss-jira] [JBoss JIRA] (JGRP-2100) Timer: don't submit non-blocking tasks to the thread pool

Bela Ban (JIRA) issues at jboss.org
Thu Sep 8 06:47:00 EDT 2016


    [ https://issues.jboss.org/browse/JGRP-2100?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13290434#comment-13290434 ] 

Bela Ban commented on JGRP-2100:
--------------------------------

Instead of subclassing {{Runnable}} with something like {{BlockableRunnable}}, an additional parameter {{can_block}} will be added to methods {{execute()}}, {{schedule()}}, {{scheduleWithFixedDelay()}}, {{scheduleAtFixedRate()}} and {{scheduleRecurringTask()}}.

Extending {{Runnable}} would not allow for simple lambdas to be used, but instead inner classes would have to be created.

> Timer: don't submit non-blocking tasks to the thread pool
> ---------------------------------------------------------
>
>                 Key: JGRP-2100
>                 URL: https://issues.jboss.org/browse/JGRP-2100
>             Project: JGroups
>          Issue Type: Feature Request
>            Reporter: Bela Ban
>            Assignee: Bela Ban
>             Fix For: 4.0
>
>
> Currently, {{TimeScheduler3}} has a runner thread which continually takes tasks from a {{DelayQueue}} and submits them to the thread pool.
> If a task is non-blocking, this is not necessary; instead the task can be run on the runner's thread. This will reduce the number of thread created in the thread pool.
> Investigate whether it is possible to mark tasks as blocking or non-blocking. Example: an {{AgeOutCache}} task is always non-blocking. A {{UNICAST3}} or {{NAKACK2}} retransmission task is (potentially) blocking if {{TCP}} is used as transport and non-blocking if for example {{UDP}} or {{TCP_NIO2}} are used.



--
This message was sent by Atlassian JIRA
(v6.4.11#64026)


More information about the jboss-jira mailing list