system timer queue
时间:2009-04-19 来源:bobcuer
500)this.width=500;" border=0>
1. high efficiency algorithm
2. divide the timers based on their expirations
3. always handling the timers in the first L2 queue
4. when one of the L2 queue is empty, move the coming timers from it’s next one
5. algorithm analysis: add and delete 1 timer: O(1), search 1 timer: O(avg(L2queue’s length))
相关阅读 更多 +