Excerpts from Alexander Kjeldaas's message of Thu Jan 31 01:43:51 -0800 2013:
> What operations do you mostly do in the priority queue?Insert, removeEmpty, and the occasional delete.
Interesting! That sounds simple enough to merit an implementation. However,
> I'd like to point you to the timer implementation that we did in the linux
> kernel ages ago. It is basically a set of log2 slots where each slot
> contains timers for time [2^i..2^(i+1)>. The dlinked lists make it O(1) to
> remove, change, or add a timer. The timer interrupt basically "eats"
> linked lists, and when empty "splats" the first free slot out over the
> upper slots (which is O(n) worst case). The structure is simple and
> optimized for doing a lot of mutation of the timers. It beats a heap hands
> down in the kernel at least.
I'm given to understand that the current kernel scheduler uses a red-black
tree? (I also have an implementation of one of those, though it's based off of
jemalloc's implementation.)
Edward