Giter Club home page Giter Club logo

Comments (4)

tjumcw avatar tjumcw commented on August 22, 2024

我觉得你说的没问题,我当时没考虑效率,本身后来也想改但是老是偷懒,后面的lab也有一些很多可以优化的地方。就是用epoll监听定时任务,timerfd_create应该能创建定时任务,然后用epoll监听定时事件,应该没问题。顺便说一嘴,我现在好久没碰cpp了,gpt了一下发现有这个timerfd_create系统调用

from 6.824.

monifeng avatar monifeng commented on August 22, 2024

我觉得你说的没问题,我当时没考虑效率,本身后来也想改但是老是偷懒,后面的lab也有一些很多可以优化的地方。就是用epoll监听定时任务,timerfd_create应该能创建定时任务,然后用epoll监听定时事件,应该没问题。顺便说一嘴,我现在好久没碰cpp了,gpt了一下发现有这个timerfd_create系统调用

好的,非常感谢,确实如果从头开始做这个连框架和测试代码都没有的项目实在是太困难,有作者分享作为参考的确能少走很多弯路。

from 6.824.

tjumcw avatar tjumcw commented on August 22, 2024

加油

from 6.824.

monifeng avatar monifeng commented on August 22, 2024

之前读源码没仔细读,并不会阻塞主线程,因为该计时线程在 waitMap() 函数里中已经detach了,只会阻塞单独的计时线程。

from 6.824.

Related Issues (8)

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.