Category: 

What Is a Message Loop?

Article Details
  • Written By: Helen Akers
  • Edited By: Jessica Seminara
  • Last Modified Date: 30 October 2016
  • Copyright Protected:
    2003-2016
    Conjecture Corporation
  • Print this Article
Free Widgets for your Site/Blog
The Argentinian resort town of EpecuĂ©n was submerged by flooding for years; it is now populated by one elderly man.  more...

December 5 ,  1933 :  Prohibition ended in the US.  more...

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.

Ad

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.

Ad

You might also Like

Recommended

Discuss this Article

Post your comments

Post Anonymously

Login

username
password
forgot password?

Register

username
password
confirm
email