What this book covers
Chapter 1, Parallel Programming Paradigms, explores different architectures and models for building parallel systems, along with various parallel programming paradigms and their performance metrics.
Chapter 2, Processes, Threads, and Services, delves into processes in operating systems, examining their life cycle, inter-process communication, and the role of threads, including daemons and multithreading.
Chapter 3, How to Create and Manage Threads in C++, instructs on how to create and manage threads, pass arguments, retrieve results, and handle exceptions to ensure efficient execution in multithreaded environments.
Chapter 4, Thread Synchronization with Locks, explains the use of C++ Standard Library synchronization primitives, including mutexes and condition variables, while addressing race conditions, deadlocks, and livelocks.
Chapter 5, Atomic Operations, explores insights into C++ atomic types, memory models, and how to implement a basic SPSC lock-free queue, preparing for future performance enhancements.
Chapter 6, Promises and Futures, introduces asynchronous programming concepts, including promises, futures, and packaged tasks, and shows how to tackle real-life problems using these tools.
Chapter 7, The Async Function, explores the functionality of std::async
for executing asynchronous tasks, defining launch policies, handling exceptions, and optimizing performance.
Chapter 8, Asynchronous Programming Using Coroutines, describes C++ coroutines, their basic requirements, and how to implement generators and parsers, while handling exceptions within coroutines.
Chapter 9, Asynchronous Programming Using Boost.Asio, explains how to use Boost.Asio for managing asynchronous tasks related to external resources, focusing on I/O objects, execution contexts, and event processing.
Chapter 10, Coroutines with Boost.Cobalt, explores the Boost.Cobalt library to implement coroutines easily, avoiding low-level complexities and focusing on functional programming needs.
Chapter 11, Logging and Debugging Asynchronous Software, explains how to effectively use logging and debugging tools to identify and resolve issues in asynchronous applications, including deadlocks and race conditions.
Chapter 12, Sanitizing and Testing Asynchronous Software, explores how to use sanitizers for multithreaded code and explores testing techniques tailored for asynchronous software with the GoogleTest library.
Chapter 13, Improving Asynchronous Software Performance, examines performance measurement tools and techniques, including high-resolution timers, cache optimization, and strategies to avoid false and true sharing.