Giter Site home page Giter Site logo

Comments (6)

lesismal avatar lesismal commented on May 7, 2024 1

其实就是 SetReadDeadline,timing-wheel 不够精确、tick间隔越低越精确但是就可能empty loop更多,所以并不是很划算,定时器这种优先级队列场景还是 heap timer 更好些。有兴趣可用参考下我这的实现:
https://github.com/lesismal/nbio/blob/master/conn_unix.go#L223

from netpoll.

Hchenn avatar Hchenn commented on May 7, 2024

是的,这个确实没有找到很好的实现,主要是代价较大,我们再评估一下,或考虑移除它。
现在可能要自定义实现,通过 context 或者 timer。

from netpoll.

WineChord avatar WineChord commented on May 7, 2024

确实,踢空闲连接和 keep alive 没什么关系,踢掉空闲连接需要类似于 timer 的东西来支持,可以参考 muduo 书的 7.10 使用时间轮来踢

from netpoll.

da-tai avatar da-tai commented on May 7, 2024

确实,踢空闲连接和 keep alive 没什么关系,踢掉空闲连接需要类似于 timer 的东西来支持,可以参考 muduo 书的 7.10 使用时间轮来踢

Do you have an example of this implementation we can use as a workaround in the meantime?

from netpoll.

WineChord avatar WineChord commented on May 7, 2024

确实,踢空闲连接和 keep alive 没什么关系,踢掉空闲连接需要类似于 timer 的东西来支持,可以参考 muduo 书的 7.10 使用时间轮来踢

Do you have an example of this implementation we can use as a workaround in the meantime?

You may refer to http://www.cs.columbia.edu/~nahum/w6998/papers/ton97-timing-wheels.pdf.

And Google something like heap-based timer, timing-wheel, etc.

from netpoll.

HeyJavaBean avatar HeyJavaBean commented on May 7, 2024

cool

from netpoll.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.