Solutons Lounge

polling – How to convert a poll based architecture into an event driven one


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

Exit mobile version