Maintaining User Responsiveness

The particular implementation of the message handling concept under Presentation Manager means that it is possible for a user to be "locked out" of the system if a window procedure does not return from processing a message within a reasonable period of time, since Presentation Manager only dispatches messages from the system queue to other applications when the currently active application attempts to retrieve a message from its queue.

The "reasonable" period of time is defined under Presentation Manager guidelines to be 0.1 seconds; a window procedure should complete the processing of a message within this period and return control to the application's main routine in order that the main routine may issue its next WinGetMsg() call. While this time period is adequate for processing of most messages, it may be insufficient for some messages; for examples, those that involve lengthy operations such as access to a remote system.

In order to avoid the situation where an application or the entire Presentation Manager environment is unresponsive to the end user, OS/2 allows applications to create secondary threads of execution to handle lengthy processing, thus enabling the application's primary thread to continue responding to user interaction. Presentation Manager also provides a number of methods by which synchronization between threads may be achieved in order to ensure the integrity of the user's intention and of data resources manipulated by the application. The use of secondary threads, and techniques for synchronizing execution between threads and processes, are discussed in Multitasking Considerations.


[Back: Message Boxes]
[Next: Summary]