We may earn an affiliate commission when you visit our partners.
Course image
James Raynard

Please note that this course is currently being updated. All the videos are being re-recorded, and new material will be added. I will try to minimize disruption, but there may be times when it is unavoidable.

Multithreading is used in many areas of computing, including graphics processing, machine learning and Internet stores. An understanding of threads is essential to make full use of the capabilities of modern hardware.

C++ now provides direct support for threads, making it possible to write portable multithreaded programs which have well-defined behaviour, without requiring any external libraries.

Read more

Please note that this course is currently being updated. All the videos are being re-recorded, and new material will be added. I will try to minimize disruption, but there may be times when it is unavoidable.

Multithreading is used in many areas of computing, including graphics processing, machine learning and Internet stores. An understanding of threads is essential to make full use of the capabilities of modern hardware.

C++ now provides direct support for threads, making it possible to write portable multithreaded programs which have well-defined behaviour, without requiring any external libraries.

This course thoroughly covers the basics of threading and will prepare you for more advanced work with threads. Source code is provided for all the examples. No previous knowledge of threading is required, but you should be comfortable with programming in C++ at an intermediate level, using "Modern" features such as smart pointers and move semantics.

We start with the concepts of multithreading and learn how to launch threads in C++. We look at the problems which can occur with multiple threads and how to avoid them.

C++ provides tools which allow us to work at a higher level of abstraction than system threads which share data; we cover condition variables and promises with futures. We will also look at asynchronous, lock-free and parallel programming, including atomic variables and the parallel algorithms in C++17. We will finish the course by implementing a concurrent queue and thread pool, which will bring together the material you have learnt.

There are downloadable exercises for each video, with solutions, so you can check your understanding as you learn, gaining familiarity and confidence with the material. There are also some optional assignments, which are more challenging.

I will be actively supporting the course. I will respond promptly if you have any questions or experience difficulties with the course content. Please feel free to use the Q&A feature or alternatively you can send me a private message.

Enroll now

What's inside

Learning objectives

  • How to write portable multi-threaded code in c++
  • Basic principles of multi-threading which will be applicable in all languages
  • Understanding of concurrency
  • Knowledge of c++17 parallel algorithms

Syllabus

Introduction
Lecturer Introduction
Guide to Exercises and Source Code
Review of the Modern C++ Features used in this course
Read more

Initializers, literals, auto and range-for loops.

Lambda expressions.

Move semantics.

Lvalues and rvalues.

Move-only objects, random numbers.

A closer look at the C++ thread class.

How to manage a launched thread.

Launching multiple threads. This is where the "fun" starts!

Example of a data race.

How to overcome a problem with using mutexes directly.

A more fully-featured wrapper class that overcomes a problem with using mutexes directly.

How to wait for a lock on a mutex without blocking indefinitely.

Avoid unnecessary locking when there are many more reading threads than writers.

How to initialize shared data safely. Threadsafe Singleton implementation.

How to create data that is local to a thread.

How to create an atomic variable

How to write a spin lock

Odds and ends to finish off the section.

Introduce the basic concept of parallelism

Introduction to execution policies

How to choose an execution policy, implications for exception handling

A brief look at the new parallel algorithm functions in C++17.

We continue our brief look at the new parallel algorithm functions in C++17.

Hands-on session where we create a basic concurrent queue.

How to really improve the performance of thread-intensive programs.

Hands-on session where we create a basic thread pool.

Traffic lights

Read about what's good
what should give you pause
and possible dealbreakers
Teaches multithreading, which is a cornerstone of modern programming, a key topic for intermediate and advanced coders
Taught by James Raynard, a recognized expert in multithreading and industry thought leader
Examines C++, a key tool used in graphics processing, machine learning, and Internet stores
Provides exercises, solutions, and optional assignments to help learners check their understanding as they progress
This intermediate course requires comfort with C++ at an intermediate level

Save this course

Create your own learning path. Save this course to your list so you can find it easily later.
Save

Reviews summary

Mastering multithreading with modern c++

According to students, this course offers a comprehensive and clear path to mastering C++ multithreading. Learners consistently praise the instructor's ability to explain complex topics with exceptional clarity, making advanced concepts like mutexes, condition variables, and futures accessible. The course is highlighted for its strong hands-on approach, providing valuable exercises and culminating in practical projects such as a concurrent queue and thread pool. Recent updates have significantly improved the course's production quality and added new, invaluable content, addressing prior feedback. While requiring a solid intermediate C++ background, it's considered a must-take for serious C++ developers looking to build portable, high-performance concurrent applications.
The instructor provides active and prompt support for student questions.
"The instructor's quick responses in Q&A were very helpful."
"Instructor is extremely responsive in Q&A, which is a big plus."
"I now feel confident tackling multithreaded applications thanks to the excellent content and support."
Recent updates have significantly enhanced video quality and added valuable new content.
"The updated content on C++17 parallel algorithms is excellent. The updated course material is a huge improvement! The new videos are crisp."
"While older videos had some sound quality issues, the re-recorded sections and new material are invaluable."
"The updated material is top-notch. It's great to see the course evolve and address previous feedback."
Practical exercises and a capstone project deeply reinforce theoretical knowledge.
"The hands-on exercises truly solidify the concepts. I especially appreciated the final project on the concurrent queue and thread pool."
"The exercises are helpful and well-designed. The concurrent queue and thread pool implementations are challenging but rewarding."
"The hands-on coding and projects are the strongest part of the course for me, really helping to solidify my understanding."
Complex multithreading concepts are broken down into digestible and understandable lessons.
"The instructor's explanations are incredibly clear, breaking down complex topics like mutexes and condition variables into digestible segments."
"This course completely demystified multithreading for me. The explanations of data races and deadlocks were particularly insightful."
"The instructor handles incredibly complex concepts with such ease and clarity. Every topic... is explained meticulously with practical code."
Some advanced sections could benefit from more in-depth coverage or examples.
"I found the section on lock-free programming a bit dense and could use more practical examples."
"I wish there were more advanced topics or deeper dives into performance considerations. The lock-free section felt a bit abstract."
"The C++17 parallel algorithms section, while concise, could be expanded to provide more depth for expert-level needs."
A solid foundation in modern C++ features is essential for success.
"Prerequisites are real – be comfortable with modern C++. This course is definitely for intermediate C++ developers."
"This course is a must for anyone serious about modern C++ concurrency, but ensure you meet the C++ knowledge requirements."
"I found it too basic initially for my needs as an experienced C++ developer, but it picked up later. Good for those new to multithreading, even if they know C++."

Activities

Be better prepared before your course. Deepen your understanding during and after it. Supplement your coursework and achieve mastery of the topics covered in Learn Multithreading with Modern C++ with these activities:
Review asynchronous programming concepts
Refreshing your knowledge of asynchronous programming will provide a solid foundation for understanding how to avoid thread blocking effectively and handle tasks efficiently.
Browse courses on Asynchronous Programming
Show steps
  • Review notes or articles on asynchronous programming concepts.
  • Go through code examples or tutorials that demonstrate asynchronous programming in C++.
Organize and review course materials
Regularly organizing and reviewing your course materials will help you stay on top of the content and improve your retention and comprehension.
Show steps
  • Go through your notes, assignments, quizzes, and exams.
  • Identify any gaps in your understanding.
  • Revisit relevant sections of the course material to fill those gaps.
Follow tutorials on advanced multithreading techniques
Exploring tutorials on advanced multithreading techniques will broaden your knowledge and expose you to different approaches and best practices.
Browse courses on Concurrency
Show steps
  • Identify reputable sources or platforms offering tutorials on advanced multithreading concepts.
  • Select tutorials that align with your learning objectives.
  • Follow the tutorials, taking notes and implementing the code examples provided.
Three other activities
Expand to see all activities and additional details
Show all six activities
Practice C++ multithreading exercises
Completing each of the downloadable exercises with solutions will help you improve your understanding of multithreading concepts and apply them effectively in C++.
Show steps
  • Review the instructions and exercise description.
  • Attempt to solve the exercise on your own.
  • Check your solution against the provided solutions.
Write a blog post on a multithreading topic
Writing a blog post will help you synthesize and reinforce your understanding of multithreading concepts, while also potentially benefiting others who read your post.
Browse courses on Multithreading
Show steps
  • Choose a specific topic related to multithreading based on the course content.
  • Research and gather information on the topic.
  • Outline and draft your blog post.
  • Revise and edit your post for clarity and accuracy.
Build a multithreaded web server
Developing a web server using multithreading techniques will provide a practical application of the concepts covered in the course, allowing you to solidify your understanding.
Browse courses on Multithreading
Show steps
  • Choose a suitable web framework and development environment.
  • Design and implement a multithreaded architecture for handling client requests.
  • Test and debug the web server to ensure it handles multiple requests efficiently.
  • Deploy the web server and monitor its performance.

Career center

Learners who complete Learn Multithreading with Modern C++ will develop knowledge and skills that may be useful to these careers:

Reading list

We haven't picked any books for this reading list yet.

Share

Help others find this course page by sharing it with your friends and followers:

Similar courses

Similar courses are unavailable at this time. Please try again later.
Our mission

OpenCourser helps millions of learners each year. People visit us to learn workspace skills, ace their exams, and nurture their curiosity.

Our extensive catalog contains over 50,000 courses and twice as many books. Browse by search, by topic, or even by career interests. We'll match you to the right resources quickly.

Find this site helpful? Tell a friend about us.

Affiliate disclosure

We're supported by our community of learners. When you purchase or subscribe to courses and programs or purchase books, we may earn a commission from our partners.

Your purchases help us maintain our catalog and keep our servers humming without ads.

Thank you for supporting OpenCourser.

© 2016 - 2025 OpenCourser