[ 
https://issues.apache.org/jira/browse/TS-1405?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13616342#comment-13616342
 ] 

John Plevyak commented on TS-1405:
----------------------------------

I am still concerned about race conditions with the v9 patch.  In particular 
when the cancelled flag is set is possible (but not certain) that the event 
will be in the atomic list.  If it is, then it should not be free'd, but if it 
is not it should be. Doing the wrong thing is either a leak or memory 
corruption. Furthermore, if we are cancelling from a different thread than the 
one the Event is on, the in_the_priority_queue flag is racy (it may change at 
any time) and hence should not be relied upon.

Attached please find v10.  This patch converts the 'cancelled' flag into a 
multi-state variable which captures whether or not the Event is in the atomic 
list.   All tests of the "cancelled" variable now do the right thing with 
respect to the state of the event.

Bin Chen: please take a look at this patch and consider the possible races and 
tell me what you think.
                
> 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.2
>
>         Attachments: linux_time_wheel.patch, linux_time_wheel_v10jp.patch, 
> linux_time_wheel_v2.patch, linux_time_wheel_v3.patch, 
> linux_time_wheel_v4.patch, linux_time_wheel_v5.patch, 
> linux_time_wheel_v6.patch, linux_time_wheel_v7.patch, 
> linux_time_wheel_v8.patch, linux_time_wheel_v9jp.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

Reply via email to