3 ms·
The TimerWheel abstraction, implemented for example: - https://github.com/facebook/folly/blob/master/folly/io/async/HHWheelTimer.h https://github.com/facebook/f
by markpapadakis 10y ago
The TimerWheel abstraction, implemented for example:
- https://github.com/facebook/folly/blob/master/folly/io/async/HHWheelTimer.h https://github.com/facebook/folly/blob/master/folly/io/async... (Facebook/Folly)
- https://github.com/real-logic/Agrona/blob/886d7744fa15fc3de14a80ec285f1abb8805385b/src/main/java/org/agrona/TimerWheel.java https://github.com/real-logic/Agrona/blob/886d7744fa15fc3de1... (Real-Logic/Argona)
and in turn based on the Linux Kernel's "Timer Wheel" data structure (see here: https://lwn.net/Articles/646950/ https://lwn.net/Articles/646950/) are particularly elegant algorithms; great performance characteristics, except that you really can't get in O(1) the time when the next timer is going to fire, in order to implement a tickless scheduler, etc.
In that article, a new timer wheel draft is described - that solves most of the shortcomings of the original TW design.