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.
Lowtierman is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.