More Concurrent Thinking in C++: Beyond the Basics [2020 Class Archive]

More Concurrent Thinking in C++: Beyond the Basics is a three-day online training course taught by Anthony Williams of Just Software Solutions. It is offered online from 11AM to 5PM Eastern Time (EDT),  Wednesday September 9th through Friday September 11th, 2020 (before the conference).

Course Description

Threads and locks are just the basics of multithreaded code. It is important to know how to use these fundamental building blocks, but they are just that: building blocks. This class is for those looking to move to the next level, at high level library and application design.

In this workshop you will learn how to use the basic building blocks to build better reusable abstractions that can simplify the high level code: thread pools, actors, and executors. This will include issues to watch out for when writing and using such abstractions, and how to avoid them.

You will learn about the new multithreading facilities being introduced to upcoming versions of the C++ Standard and how they will simplify your life as a library or application developer.

You will encounter the issues surrounding scalability, the pitfalls that arise when you run code designed for small numbers of cores or increasingly large numbers of cores, and how to design your code to minimize the problems.

Finally, you will also be shown how to test multithreaded code, including the use of tools like Thread Sanitizer.

There will be exercises throughout the workshop.

Prerequisites

Students are expected to have a good knowledge of C++, and familiarity with the C++11 standard thread library.

Students will require a laptop with one of the following compilers to handle the example code:

  • Microsoft Visual Studio 2017 or later.
  • gcc 7 or later
  • clang 5 or later

Course Topics

  • Thread pools and tasks
    • How to write a thread pool. Potential issues with thread pools.
    • Task allocation strategies such as work stealing.
  • Managing lifetimes with concurrent tasks
  • Actors
    • Using actors and message-passing to simplify concurrent code.
  • New facilities from future C++ Standards:
    • RCU and hazard pointers
    • Executors
    • Latches and barriers
  • Testing concurrent code
    • How to test multithreaded code, including the use of tools like Thread Sanitizer
  • Scalability
    • Writing code that works across a wide range of systems, or scales as the system grows.
  • Atomics and lock-free code
    • Refresher on the C++ memory model, and how to write lock-free code.

Course Instructor

AnthonyWilliams.cropped

Anthony Williams is the author of C++ Concurrency in Action, and a UK-based developer and consultant with many years of experience in C++. He has been an active member of the BSI C++ Standards Panel since 2001, and is author or coauthor of many of the C++ Standards Committee papers that led up to the inclusion of the thread library in the C++11 Standard. He is the developer of the just::thread implementation of the C++11 thread library from Just Software Solutions Ltd. Anthony lives in the far west of Cornwall, England.