I have a priority queue of tasks ordered by timestamps. I also have a main loop that keeps peeking at the top of the queue for the timestamp, iterating until the current time has reached the timestamp before popping the event and executing it. Is there a way to convert this polling architecture into an event driven one, or must I redesign the entire thing. Any help would be appreciated.

I cannot fathom a way to handle this apart from busy waiting, which I know is quite inefficient.



Source link

Leave a Reply

Your email address will not be published. Required fields are marked *