Microsoft KB Archive/42223

From BetaArchive Wiki

MSJ BIGJOB: OS/2 PM Multithread Programming Techniques

PSS ID Number: Q42223 Article last modified on 04-16-1991


Summary: The following is a summary of the program found in the “Microsoft Systems Journal” and in the Software/Data Library: Issue: March 1988, Volume 3, Number 2, pages 11-27 Title: “Utilizing OS/2 Multithread Techniques in Presentation Manager Applications” Author: Charles Petzold Keyword: BIGJOB BIGJOB can be found in the Software/Data Library by searching on the keyword BIGJOB, the Q number of this article, or S10072. BIGJOB was archived using the PKware file-compression utility. The BIGJOB program demonstrates different ways to write your application so that the Presentation Manager (PM) system stays as responsive to the user as possible. It shows different ways to use threads in your application to perform a task and describes the pros and cons of each method. The following text is taken from the cover of the “Microsoft Systems Journal”: While OS/2 provides the preemptive multitasking that Windows lacks, the Presentation Manager’s message-based architecture can cause problems when doing lengthy processing. OS/2 threads offer alternative solutions to the problems that occur when programming in Presentation Manager.

More Information: Some of the PM programming concepts that this application demonstrates are: 1. Writing a multithreaded PM application 2. Using a PeekMessage() loop to keep the PM system responsive to the user 3. Using a message queue in the second thread for communication with the primary message thread 4. Using a timer to divide up the processing of the large task into pieces that don’t take as much time 5. Difficulties that are encountered when you write a multithreaded PM application 6. Using object windows to pass information between threads