Learn Multithreading with Modern C++
- Descrição
- Currículo
- FAQ
- Revisões
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.
-
4Modern C++ Overview Part OneVídeo Aula
Initializers, literals, auto and range-for loops.
-
5Modern C++ Overview Part TwoVídeo Aula
Lambda expressions.
-
6Modern C++ Overview Part ThreeVídeo Aula
Move semantics.
-
7Modern C++ Overview Part FourVídeo Aula
Lvalues and rvalues.
-
8Modern C++ Overview Part FiveVídeo Aula
Move-only objects, random numbers.
-
9Concurrency IntroductionVídeo Aula
-
10Concurrency MotivationVídeo Aula
-
11Concurrency OverviewVídeo Aula
-
12Threaded Program StructureVídeo Aula
-
13A Brief History of C++ ConcurrencyVídeo Aula
-
14Launching a ThreadVídeo Aula
-
15Launching a ThreadTexto
-
16Thread Function with ArgumentsVídeo Aula
-
17Computer with Single ProcessorVídeo Aula
-
18Computer with Single Processor and CacheVídeo Aula
-
19Computer with Multiple ProcessorsVídeo Aula
-
20Synchronization IssuesVídeo Aula
-
21System Thread InterfaceVídeo Aula
-
22The C++ Thread ClassVídeo Aula
A closer look at the C++ thread class.
-
23Managing a ThreadVídeo Aula
How to manage a launched thread.
-
24Multiple ThreadsVídeo Aula
Launching multiple threads. This is where the "fun" starts!
-
25Data RacesVídeo Aula
Example of a data race.
-
26Data RacesTexto
-
27Data Race ConsequencesVídeo Aula
-
28Critical SectionsVídeo Aula
-
29Mutex IntroductionVídeo Aula
-
30Mutex ClassVídeo Aula
-
31Internally Synchronized ClassVídeo Aula
-
32Lock GuardVídeo Aula
How to overcome a problem with using mutexes directly.
-
33Unique LockVídeo Aula
A more fully-featured wrapper class that overcomes a problem with using mutexes directly.
-
34Timeouts and MutexesVídeo Aula
How to wait for a lock on a mutex without blocking indefinitely.
-
35Multiple Reader,Single WriterVídeo Aula
-
36Shared MutexesVídeo Aula
Avoid unnecessary locking when there are many more reading threads than writers.
-
37Shared Data InitializationVídeo Aula
How to initialize shared data safely. Threadsafe Singleton implementation.
-
38Thread-local DataVídeo Aula
How to create data that is local to a thread.
-
39Lazy initializationVídeo Aula
-
40Double-checked LockingVídeo Aula
-
41DeadlockVídeo Aula
-
42Deadlock PracticalVídeo Aula
-
43Deadlock AvoidanceVídeo Aula
-
44Deadlock Avoidance PracticalVídeo Aula
-
45LivelockVídeo Aula
-
46Livelock PracticalVídeo Aula
-
47LivelockTexto
-
48Mutex ConclusionVídeo Aula
-
49Thread CoordinationVídeo Aula
-
50Thread Coordination PracticalVídeo Aula
-
51Condition VariablesVídeo Aula
-
52Condition VariablesTexto
-
53Condition Variables with PredicateVídeo Aula
-
54Condition Variable PracticalVídeo Aula
-
55Futures and Promises OverviewVídeo Aula
-
56Future and Promise ClassesVídeo Aula
-
57Futures and Promises ExamplesVídeo Aula
-
58Promises with Multiple Waiting ThreadsVídeo Aula
-
59Integer Operations and ThreadsVídeo Aula
-
60Atomic TypesVídeo Aula
How to create an atomic variable
-
61Double-checked Locking RepriseTexto
-
62Atomic OperationsVídeo Aula
How to write a spin lock
-
63Lock-free ProgrammingVídeo Aula
-
64Lock-free Programming ContinuedVídeo Aula
-
65Lock-free Programming PracticalVídeo Aula
-
66Lock-free Programming Practical ContinuedVídeo Aula
-
73Parallelism OverviewVídeo Aula
Introduce the basic concept of parallelism
-
74Parallelism Overview ContinuedVídeo Aula
-
75Data Parallelism PracticalVídeo Aula
-
76Standard Algorithms OverviewVídeo Aula
-
77Execution PoliciesVídeo Aula
Introduction to execution policies
-
78Algorithms and Execution PoliciesVídeo Aula
How to choose an execution policy, implications for exception handling
-
79New Parallel AlgorithmsVídeo Aula
A brief look at the new parallel algorithm functions in C++17.
-
80New Parallel Algorithms ContinuedVídeo Aula
We continue our brief look at the new parallel algorithm functions in C++17.
-
81Parallel Algorithms PracticalVídeo Aula
-
82New Parallel Algorithms ConclusionVídeo Aula