3 ms·
wow, the idea reminds me of epicycles (the Ptolemaean model of the solar system where he planets did loops within loops). Now i wonder if you save a lot with h
by MichaelMoser123 10y ago
wow, the idea reminds me of epicycles (the Ptolemaean model of the solar system where he planets did loops within loops).
Now i wonder if you save a lot with having to promote all these entries from the outer wheel(s) to inner wheel, one option is to pick a large enough wheel size (so that the wheel would cover most typical timeouts) and just allow collisions in the timer buckets if a timeout requires more slots than the maximum size of the wheel (just would require you to do more checks when there are collisions).
Another problem is that one has to do a lot more work when you do a full revolution of the inner wheel (due to promotions within between the outer wheels); so that each tick does take a uniform amount of time.
Another point is that these linked lists + indirections are not very cache friendly; one could try to use some sort of unrolled list (however this will eat up more memory).