장발의 개발러

Event Loop 본문

개발이즈 마이라이프/Computer Science

Event Loop

장발의 개발러 2012. 5. 17. 16:04


출처: 위키피디아


Event loop

From Wikipedia, the free encyclopedia
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 polling some internal or external "event provider", which generally blocks until an event has arrived, and then 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 event loop almost always operates asynchronously with the message originator.

When the event loop forms the central control flow construct of a program, as it often does, and is thus at the highest level of control within the program, it may be termed the main loop or main event loop.