Skip to content

Instantly share code, notes, and snippets.

View lucifer008's full-sized avatar

lucifer008

  • https://zhangxiaolin198313@163.com
  • xian
View GitHub Profile
@lucifer008
lucifer008 / Event_Loop.md
Created July 2, 2024 05:58 — forked from kassane/Event_Loop.md
Explain 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" (that 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.