O'Reilly logo

Boost C++ Application Development Cookbook by Antony Polukhin

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

Syncing interprocess communications

In the previous recipe, we saw how to create shared memory and how to place some objects in it. Now it's time to do something useful. Let's take an example from the Creating a work_queue class recipe in Chapter 5, Multithreading, and make it work for multiple processes. At the end of this example, we'll get a class that can store different tasks and pass them between processes.

Getting ready

This recipe uses techniques from the previous one. You will also need to read the Creating a work_queue class recipe in Chapter 5, Multithreading, and get its main idea. The example requires linking against the runtime library on some platforms.

How to do it...

It is considered that spawning separate subprocesses instead of ...

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