O'Reilly logo

C++ Multithreading Cookbook by Milos Ljumovic

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Understanding a message queue

To understand message passing better, let's review the message queue. Every top-level window has its own message queue that is created by the operating system. In a multitasking environment, there are many applications executed at the same time with a lot of windows displayed on the user's screen. The operating system is processing a very large number of messages, handling various events raised from the system itself, and running various applications. At the same time, the user is pressing keyboard keys, clicking the mouse, or swiping the touch screen.

To demonstrate message passing along with the queue operations, let's review the following example. Let's assume that we need to perform complex drawings represented ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required