[
https://issues.apache.org/jira/browse/TS-1405?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13588925#comment-13588925
]
Bin Chen edited comment on TS-1405 at 2/28/13 12:10 AM:
--------------------------------------------------------
# in EThread::set_event_cancel(), only cancel event in this case:
* have be inserted in priority queue (e->in_the_priority_queue) &&
e->timeout_at > now + event_cancel_delay(s)
* localQueue Event will be process soon, so don't set cancel. This will be
less cancel handler.
so canclled event won`t in race condition.
# if cancelled flag can only be set while holding the mutex of the Event, the
set_event_cancel() will more simple.
# if enable define INACITVATE_TIMEOUT, vc->timeout will be used vc. if
free_event immediatly, there still a race condition(some vc use timeout, but
this event have be freed by process_cancelled_event). so add event_cancel_delay.
was (Author: kuotai):
1. in EThread::set_event_cancel(), only cancel event in this case:
a. have be inserted in priority queue (e->in_the_priority_queue) &&
e->timeout_at > now + event_cancel_delay(s)
b. localQueue Event will be process soon, so don't set cancel. This will be
less cancel handler.
so canclled event won`t in race condition.
2. if cancelled flag can only be set while holding the mutex of the Event, the
set_event_cancel() will more sigle.
3. if enable define INACITVATE_TIMEOUT, vc->timeout will be used vc. if
free_event immediatly, there still a race condition(some vc use timeout, but
this event have be freed by process_cancelled_event). so add event_cancel_delay.
> apply time-wheel scheduler about event system
> ----------------------------------------------
>
> Key: TS-1405
> URL: https://issues.apache.org/jira/browse/TS-1405
> Project: Traffic Server
> Issue Type: Improvement
> Components: Core
> Affects Versions: 3.2.0
> Reporter: Bin Chen
> Assignee: Bin Chen
> Fix For: 3.3.1
>
> Attachments: linux_time_wheel.patch, linux_time_wheel_v2.patch,
> linux_time_wheel_v3.patch, linux_time_wheel_v4.patch
>
>
> when have more and more event in event system scheduler, it's worse. This is
> the reason why we use inactivecop to handler keepalive. the new scheduler is
> time-wheel. It's have better time complexity(O(1))
--
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