What is event loop?

Event Loop

In computer science, the event loop, message dispatcher, message loop, message pump, or run loop is a programming construct that waits for and dispatches events or messages in a program. It works by making a request to some internal or external "event provider" (which generally blocks the request until an event has arrived), and then it calls the relevant event handler ("dispatches the event"). The event-loop may be used in conjunction with a reactor, if the event provider follows the file interface, which can be selected or 'polled' (the Unix system call, not actual polling). The event loop almost always operates asynchronously with the message originator.

Read more about Event Loop.

Some articles on event loop:

Message Loop In Microsoft Windows
... Microsoft Windows programs are event-based ... or PeekMessage) function in a section of code called the "event loop." The event loop typically appears as follows int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE ... do not typically require applications to directly access the Windows message loop, but instead automatically route events such as key presses and mouse clicks to their appropriate handlers as defined ...
Event Loop - Implementations - OS X Core Foundation Run Loops
... communicate with observers through the run loop, with it organising queueing and dispatch of messages ...
OpenGL Utility Toolkit - Limitations
... integrate GLUT into a program or library which wishes to have control of its own event loop ... (freeglut/OpenGLUT), which runs only a single iteration of the GLUT event loop ... Another common workaround is to run GLUT's event loop in a separate thread, although this may vary by operating system, and also may introduce synchronization issues or other ...
Carbon (API) - Event Handling
... The Mac Toolbox's Event Manager originally used a polling model for application design ... The application's main event loop asks the Event Manager for an event using GetNextEvent ... If there is an event in the queue, the Event Manager passes it back to the application, where it is handled, otherwise it returns immediately ...

Famous quotes containing the word event:

    There is nothing that I shudder at more than the idea of a separation of the Union. Should such an event ever happen, which I fervently pray God to avert, from that date I view our liberty gone.
    Andrew Jackson (1767–1845)