[jboss-jira] [JBoss JIRA] (JGRP-1553) TimeScheduler3
Bela Ban (JIRA)
jira-events at lists.jboss.org
Wed Dec 12 09:25:17 EST 2012
Bela Ban created JGRP-1553:
------------------------------
Summary: TimeScheduler3
Key: JGRP-1553
URL: https://issues.jboss.org/browse/JGRP-1553
Project: JGroups
Issue Type: Enhancement
Reporter: Bela Ban
Assignee: Bela Ban
Fix For: 3.3
The current TimeScheduler2 class has a few deficiencies:
- taskReady() should only set next-execution-time if its argument is less than next-execution-time
- no_tasks: when setting this CAS, the result is only checked in 1 location, but not the other
- Potential loss of task: when calling schedule() on an existing Entry (same execution time), and - before adding the task to Entry - Entry is removed by _run() as it was executed, then the newly added task will never get to run !
- Simplification: instead of headMap(), just use firstEntry(), removeFirstEntry(). See pseudo code below.
As a workaround, timer_type="old" will switch back to the previous default timer. The reason for TimeScheduler3 (versus changing TimeScheduler2) is that we can simply switch to the new impl by setting (a new) timer_type="new2". Should this have a bug, we can simply switch back to "new" or "old" (or "wheel".
Over time, TimeScheduler2 will get removed.
Pseudo code:
* loop while has tasks
** get the first task
** if its time is less than the current time: execute it and remove it
** else block (on the next task or 10s) until an element is added
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list