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

ASF GitHub Bot commented on HTTPCORE-484:
-----------------------------------------

Github user xiaohu-zhang commented on the issue:

    https://github.com/apache/httpcomponents-core/pull/67
  
    1. yes,all the time out task is executed by a separate thread. but I dont 
think IOEventHandler need to synchronization because every channel has 
difference IOEventHandler instance.
    2. suppose there is n channels . every loop interval find time out task, 
original algorithm time complexity is o(n).using time wheel time complexity is 
o(n/k),where k is ticks in PerWheel. original algorithm every interval will 
loop all the task ,the more accurate,the interval need to be reduced.but there 
is contradiction between reduce interval and loop all the task in the 
interval.time wheel every click only need to loop n/k task ,so click time 
interval can be very small ,so trigger the time out task will be more 
accurate.linux ,kafka,quartz and lots of framework using time wheel deal with 
timeout task.


> check timeout could use TimeWheel algorithm
> -------------------------------------------
>
>                 Key: HTTPCORE-484
>                 URL: https://issues.apache.org/jira/browse/HTTPCORE-484
>             Project: HttpComponents HttpCore
>          Issue Type: Improvement
>          Components: HttpCore NIO
>    Affects Versions: 4.4.6
>            Reporter: silver9886
>            Assignee: Oleg Kalnichevski
>            Priority: Major
>             Fix For: 5.0-beta3
>
>
> check time out every this.selectTimeout,and had to iterator all the 
> SelectionKeys.
> it is not efficient nor accurate when their is a lot of SelectionKeys.
> I suggest use the TimeWheel algorithm when check the channel time out just
> as netty do.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to