Chapter 10. Concurrency with Boost

Threads represent concurrent streams of execution within a process. They are a low-level abstraction for concurrency and are exposed by the system programming libraries or system call interfaces of operating systems, for example, POSIX threads, Win32 Threads. On multiprocessor or multicore systems, operating systems can schedule two threads from the same process to run in parallel on two different cores, thus achieving true parallelism.

Threads are a popular mechanism to abstract concurrent tasks that can potentially run in parallel with other such tasks. Done right, threads can simplify program structure and improve performance. However, concurrency and parallelism introduce complexities and nondeterministic ...

Get Learning Boost C++ Libraries now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.