Multi-threading for C++

Plain threads

Plain vanilla threads is the most universal and in the same time most complicated approach for doing parallel processing.

Since C++17 std::for_each will support parallel execution with overload accepting execution policy (parallel or sequencial).

Asynchronous I/O

Lock-free data structures

Use them to increase performance of multi-threaded solution.

Articles

Solutions

OpenMP

OpenMP is a standard for simplified parallel program execution supported by a number of compilers including GCC, Visual Studio, Intel. It allows you to perform existing code in parallel just by adding few special directives.

Transactional memory

Introduction

Solutions

Thread Building Blocks

Open Source solution from Intel: Thread Building Blocks -

Resources

Books

  • "Structured Parallel Programming: Patterns for Efficient Computation" - Michael McCool / James Reinders / Arch Robison, 2012 - contains examples for TBB and Cilk Plus
  • "Intel Threading Building Blocks" - James Reinders, 2007

Concurrency Runtime

Resources for: Concurrency Runtime - Visual Studio: Asynchronous Agents Library, Parallel Patterns Library

  • example: concurrency::parallel_for_each example
  • book: "Parallel Programming with Microsoft Visual C++: Design Patterns for Decomposition and Coordination on Multicore Architectures (Patterns & Practices)" - Colin Campbell / Ade Miller, 2011

Books on multi-threading

Blogs on multi-threading

See also

Share

follow