Giter Club home page Giter Club logo

Comments (2)

tobyzxj avatar tobyzxj commented on May 22, 2024

数组是确定大小的,并且添加和删除都需要自己维护索引,操作比较复杂,list数据结构就比较简单了。

from timingwheel.

RussellLuo avatar RussellLuo commented on May 22, 2024

感谢 @tobyzxj 帮忙回复!

添加task的时候直接追加的数组尾部, 到期时直接遍历数组取出所有task.

我稍微补充一下:

  1. 数组扩容时会 copy 数据,不如链表高效
  2. timer.Stop() 可能会从任意位置删除元素,链表最适合这种操作

from timingwheel.

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.