Re: Timer Implementation



Patricia Shanahan <pats@xxxxxxx> wrote:
The problem may be essentially a "priority queue", in which case there
are algorithms for managing one efficiently.

Yes, good point. The waiting itself is not a problem of computation,
and has to be handled in conjunction with the operating system and
cooperating hardware. The algorithms for determining how long to wait
right now are computational.

As I understand the problem (i.e., everything is always delayed for
exactly 100 milliseconds), there is no need for a priority queue; a
standard FIFO queue will do fine. FIFO queues can easily be implemented
with constant time lookup and retrieval, so there's no significant
problem there. If I've misunderstood, then perhaps a priority queue is
what you want.

--
Chris Smith
.