An event loop monitors the mouse, keyboard, and other sources of external events and calls the appropriate parts of the programmer's code according to actions that the user performs. The programmer no longer determines the order in which events occur. Instead, a program is divided into separate pieces that get called at unpredictable times and in an unpredictable order.
By relinquishing control in this way to users, the developer creates a program
that is much easier to use. Nevertheless, individual pieces of the program
written by the developer still call libraries provided by the operating system to
accomplish certain tasks, and the programmer must still determine the flow of
control within each piece after it's called by the event loop. Application code
still "sits on top of" the system, and the programmer must know what system
services are available and when to call them.
[Contents]
[Previous]
[Next]