Hashed and hierarchical timing wheels: data structures for the efficient implementation of a timer facility
- 1 November 1987
- journal article
- Published by Association for Computing Machinery (ACM) in ACM SIGOPS Operating Systems Review
- Vol. 21 (5) , 25-38
- https://doi.org/10.1145/37499.37504
Abstract
Conventional algorithms to implement an Operating System timer module take Ο ( n ) time to start or maintain a timer, where n is the number of outstanding timers: this is expensive for large n . This paper begins by exploring the relationship between timer algorithms, time flow mechanisms used in discrete event simulations, and sorting techniques. Next a timer algorithm for small timer intervals is presented that is similar to the timing wheel technique used in logic simulators. By using a circular buffer or timing wheel, it takes Ο (1) time to start, stop, and maintain timers within the range of the wheel. Two extensions for larger values of the interval are described. In the first, the timer interval is hashed into a slot on the timing wheel. In the second, a hierarchy of timing wheels with different granularities is used to span a greater range of intervals. The performance of these two schemes and various implementation trade-offs are discussed.Keywords
This publication has 6 references indexed in Scilit:
- VAXclusterACM Transactions on Computer Systems, 1986
- Distributed operating systemsACM Computing Surveys, 1985
- Complexity Analyses of Event Set AlgorithmsThe Computer Journal, 1984
- A comparison of simulation event list algorithmsCommunications of the ACM, 1975
- Time flow mechanisms for use in digital logic simulationPublished by Association for Computing Machinery (ACM) ,1971
- Programming languages for non-numeric processing---2Published by Association for Computing Machinery (ACM) ,1965