Giter VIP home page Giter VIP logo

Comments (5)

yedf2 avatar yedf2 commented on June 11, 2024

handy支持优雅退出,方便使用工具检查内存泄漏问题
如果在某个地方调用了EventBase.exit,那么exit_会标记为true
后面还有一个loop_once是用于部分资源清理

from handy.

guanweile avatar guanweile commented on June 11, 2024

loop_once(0); 这个是epoll_wait 的超时时间为0 超时时间等于零导致epoll_wait 立即返回,即使没有可用事件 这个是用于干嘛? 清理资源?

from handy.

guanweile avatar guanweile commented on June 11, 2024

还有 一个疑问就是 loop 的时候 loop_once(10000); 没退出的时候 epoll_wait 没事件 会阻塞下面的clear() 直到 有事件到 才会clear 这样为什么要等有事件 才clear..

from handy.

guanweile avatar guanweile commented on June 11, 2024

@yedf2

from handy.

yedf2 avatar yedf2 commented on June 11, 2024

loop_once(0)会进行连接的IO处理,因为前面的处理中,可能会关闭了一部分连接,因此需要loop_once进行清理
timer这些clear本来10秒清理一次就够,所以没有必要特别频繁的去调用他

from handy.

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.