Scheduling handlers with a posted event

A single-threaded event loop processes a FIFO event queue and is idle at time 0 ms. Dispatch overhead is negligible, and each handler runs for the handler time shown. Four events come from outside the program. The fifth, Redraw E, is posted by Key B's handler: it is appended to the back of the queue at the moment that handler finishes. Complete the table, giving every time in milliseconds as a whole number.

EventArrives (ms)Handler time (ms)Starts (ms)Finishes (ms)
Click A015
Key B46
Tick C103
Click D3015
Redraw E2

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

More Event-Driven Programming Questions: