Spiegato, Home

Technology and Gadgets

What Is a Message Loop?

  • Published by Spiegato
  • 2 min read

A message loop is comprised of communication parameter code that computer applications use to execute functions. Messages are sent to get the application to do something such as open a new window or send a word processing document to the printer. The user of the software application also receives messages when the program requires a response or action in order to continue. When a related set of messages is sent and received in order to perform a function, it is considered to be a message loop.

Some computer applications require a message queue for a few of their functions. The queue documents an ongoing dialogue of requests that are initiated by the user of the application as well as the software program. A message loop is required when an application must open more than one window. Messages from the queue are transferred by the message loop to the window that needs the commands to properly execute its request.

The communication process can be thought of as a circle. A command to get a message is sent. The other end then sends a command to dispatch the requested message. Since two-way communication and responses travel back and forth, it creates a loop-like dialogue.

A computer application performs this type of communication process in the background. It is not visibly noticeable from the application’s graphical interface. Experienced users who have intermediate to advanced technical knowledge can input commands to view the message queue dialog while it is in process. They might also be able to input manual commands if they need to troubleshoot an issue.

Messages get logged with either a positive or negative value once they enter the queue. As part of the message loop process, command messages must also be translated. The program attempts to process what the command means and how it should be handled. A message dispatch command then routes the message accordingly.

The dispatch message command is a sign that the loop has completed. At this point the message queue has processed all the command messages that are needed to execute a particular function in the software application. The loop is considered to be back at the beginning of its cycle and is waiting for the next string of commands.
Errors in a message loop are processed as negative values. The software program may send a request to the user asking him to respond or do something to clear the error. This may involve exiting the software program.

Key terms in this article

Related articles

  • What Is an Event Loop?

    An event loop — or main loop, if it is the central control aspect — is a construct within programs that controls and dispatches events following an…

  • What is an Infinite Loop?

    An infinite loop is a condition that causes a computer program to continue executing a command without end. This is typically due to one of three causes…

  • What is a Nested Loop?

    A nested loop is a logical structure used in computer programming and coding. It is characterized by two or more repeating statements that are placed in a…

  • What is a Loop Antenna?

    A loop antenna is an antenna that creates a continuous conducting path between one conductor of a two-wire transmission line to the other. There are three…

  • What Is Message Switching?

    Message switching is a telecommunications data transfer method that was first introduced in 1961; unlike packet switching that came after, message…