What is event polling?

Arif Amjad

Event polling is (in very broad terms) a lot like the way people handle email. The messages pile up in a box as they arrive, and the user periodically checks to see if anything new is in the box.

An event-polling OS catches input signals (keystrokes, mouse clicks, etc.. they're collectively known as 'events') and piles them up in a list called the 'event queue'.

In a multitasking, event polling OS, each program has a private event queue as part of its context. the OS identifies signals as they come in and adds them to the appropriate queue. then each program checks its queue for events while its context is switched in.

[FAQ Manager Note] Please see http://www.jguru.com/jguru/faq/view.jsp?EID=8963 for details on how Java uses event polling. In your application, you don't need to poll, because the Java Runtime Environment automatically creates a thread (the "AWT Thread") to poll for you.