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

Using the thread message queue

As we said earlier, we can send a message to the thread without creating the window (UI). In our previous example, we were simply using the message queue created for the thread because it owns a window. Here, we will explain the ability to pass messages without using the window message queue.

Due to the simplicity of the example, we will send a message to the thread each time the user clicks on a button.

An analogy to such a task would be if we want to create an application that will display information about the weather forecast, we will have two threads: one is responsible for physical devices such as pressure meter, wind speed meter, and similar, while the other thread needs to wait for the data collected from the ...

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