In computer science, the event loop, message dispatcher, message loop or message pump 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 . 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.

PropertyValue
p:abstract
  • In computer science, the event loop, message dispatcher, message loop or message pump 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 . 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. (en)
  • メインループ(Main loop)とは、イベント駆動型GUIなどの機能を持つアプリケーションで典型的な設計手法。イベントループ(Event loop)とも呼ばれる。常に実行されているループを持ち、ユーザーイベントの有無をループする度に確認し、それイベントを処理する。何らかの方法でイベントを処理すると、制御は前述のループに戻り、次にイベントが発生するまでループを回り続ける。このようなプログラムではループが最上位の制御構造となっており、そのため「メイン」と名づけられている。 この手法は以下のような他の手法とは対照的である: 古くからある、単純に一回動作して終了するプログラム。この種のプログラムは情報処理の最初期からあり、ユーザーとの対話手段を持たない。現在も主にCUI指向のプログラムでよく使われている。各種パラメータを指定して起動される。 メニュー駆動型設計。この場合も一種のメインループは存在するが、ユーザーから見てイベント駆動的ではない。イベント駆動の代わりとして、階層型のメニューを順次選択していって、希望する動作を指定する。このメニューを通した限定的な対話性がある。 最近のアプリケーションの多くはメインループを持つ。ただし、プリエンプティブ・マルチタスクを使用するとメインループはしばしば中断され、そのアプリケーションに実際に何らかのイベントが発生したときだけ再開されるようになる。これはアプリケーションがイベントの到着を確認しながら待つ(ポーリング)よりも効率的である。ポーリングはプリエンプティブでないマルチタスクでは一般的な手法であった。 以下の擬似コードはメインループの典型例である: begin initialize_everything; mainloop: event = next_event; process_event; if (event = quit) terminate; else goto mainloop; end; (ja)
  • Eine Ereignisschleife (eng. event loop, message dispatcher, message loop oder message pump) ist in der Informatik ein Programmkonstrukt, das auf Ereignisse oder Meldungen wartet und sie innerhalb eines Programms verteilt. Ereignisquellen werden abgefragt und die für das Ereignis bzw. die Meldung zuständige Funktion wird aufgerufen. Oft stellt diese Schleife den zentralen Kontrollfluss dar und wird deshalb auch als Hauptschleife oder Hauptereignisschleife bezeichnet. (de)
p:hasPhotoCollection
p:manProperty
  • pselect (en)
  • synchronous I/O multiplexing (en)
  • 2 (xsd:integer)
p:wikiPageUsesTemplate
rdfs:comment
  • In computer science, the event loop, message dispatcher, message loop or message pump 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 . 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. (en)
  • メインループ(Main loop)とは、イベント駆動型GUIなどの機能を持つアプリケーションで典型的な設計手法。イベントループ(Event loop)とも呼ばれる。常に実行されているループを持ち、ユーザーイベントの有無をループする度に確認し、それイベントを処理する。何らかの方法でイベントを処理すると、制御は前述のループに戻り、次にイベントが発生するまでループを回り続ける。このようなプログラ� ではループが最上位の制御構� となっており、そのため「メイン」と名づけられている。 この手法は以下のような他の手法とは対照的である: 古くからある、単純に一回動作して終了するプログラ� 。この種のプログラ� は情� �処理の最初期からあり、ユーザーとの対話手段を持たない。現在も主にCUI指向のプログラ� でよく使われている。各種パラメータを指定して起動される。 メニュー駆動型設計。この� �合も一種のメインループは存在するが、ユーザーから見てイベント駆動的ではない。イベント駆動の代わりとして、階層型のメニューを� �次選択していって、希望する動作を指定する。このメニューを通した限定的な対話性がある。 最近のアプリケーションの多くはメインループを持つ。た� し、プリエンプティブ・マルチタスクを使用するとメインループはしばしば中断され、そのアプリケーションに実際に何らかのイベントが発生したとき� け再開されるようになる。これはアプリケーションがイベントの到着を確認しながら待つ(ポーリング)よりも効率的である。ポーリングはプリエンプティブでないマルチタスクでは一般的な手法であった。 以下の擬似コードはメインループの典型例である: (ja)
  • Eine Ereignisschleife (eng. event loop, message dispatcher, message loop oder message pump) ist in der Informatik ein Programmkonstrukt, das auf Ereignisse oder Meldungen wartet und sie innerhalb eines Programms verteilt. (de)
rdfs:label
  • Event loop (en)
  • メインループ (ja)
  • Ereignisschleife (de)
owl:sameAs
skos:subject
foaf:page