Mô tả

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.

Bạn sẽ học được gì

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

Yêu cầu

  • Familiarity with Advanced Modern C++ features such as lambda expressions and move semantics
  • Access to C++11 compiler (C++14 preferred.) Parallel algorithms require C++17
  • Intended for students who have taken my courses "Learn Advanced Modern C++" or "Update to Modern C++"
  • Proficiency in English (B2 level, preferably C1)

Nội dung khoá học

12 sections

Introduction

3 lectures
Introduction
02:45
Lecturer Introduction
00:59
Guide to Exercises and Source Code
00:28

Review of Modern C++ Features

5 lectures
Modern C++ Overview Part One
08:44
Modern C++ Overview Part Two
08:34
Modern C++ Overview Part Three
10:17
Modern C++ Overview Part Four
09:44
Modern C++ Overview Part Five
09:32

Introduction to Concurrency

12 lectures
Concurrency Introduction
03:06
Concurrency Motivation
09:04
Concurrency Overview
04:26
Threaded Program Structure
02:23
A Brief History of C++ Concurrency
03:37
Launching a Thread
08:15
Launching a Thread
1 question
Thread Function with Arguments
07:11
Computer with Single Processor
08:37
Computer with Single Processor and Cache
04:30
Computer with Multiple Processors
07:10
Synchronization Issues
04:07

Getting Started with Threads

7 lectures
System Thread Interface
06:54
The C++ Thread Class
06:08
Managing a Thread
06:57
Multiple Threads
07:30
Data Races
04:39
Data Races
2 questions
Data Race Consequences
10:48

Working with shared data

21 lectures
Critical Sections
02:25
Mutex Introduction
03:22
Mutex Class
05:59
Internally Synchronized Class
04:11
Lock Guard
07:26
Unique Lock
06:16
Timeouts and Mutexes
08:58
Multiple Reader,Single Writer
05:46
Shared Mutexes
07:40
Shared Data Initialization
08:15
Thread-local Data
03:30
Lazy initialization
03:15
Double-checked Locking
05:39
Deadlock
04:31
Deadlock Practical
07:46
Deadlock Avoidance
09:04
Deadlock Avoidance Practical
05:14
Livelock
05:12
Livelock Practical
03:18
Livelock
2 questions
Mutex Conclusion
04:48

Thread Synchronization

10 lectures
Thread Coordination
02:10
Thread Coordination Practical
08:41
Condition Variables
06:35
Condition Variables
1 question
Condition Variables with Predicate
07:43
Condition Variable Practical
04:59
Futures and Promises Overview
04:22
Future and Promise Classes
03:33
Futures and Promises Examples
06:27
Promises with Multiple Waiting Threads
03:37

Atomic Types

8 lectures
Integer Operations and Threads
07:39
Atomic Types
05:19
Double-checked Locking Reprise
2 questions
Atomic Operations
08:33
Lock-free Programming
04:18
Lock-free Programming Continued
07:14
Lock-free Programming Practical
03:58
Lock-free Programming Practical Continued
07:19

Asynchronous Programming

6 lectures
Asynchronous Programming
06:50
Packaged Task
07:05
Packaged Task Assignment
1 question
The async Function
05:13
The async Function and Launch Options
06:13
Choosing a Thread Object
05:47

Parallelism

10 lectures
Parallelism Overview
05:00
Parallelism Overview Continued
08:00
Data Parallelism Practical
05:51
Standard Algorithms Overview
08:32
Execution Policies
11:24
Algorithms and Execution Policies
04:36
New Parallel Algorithms
08:09
New Parallel Algorithms Continued
05:38
Parallel Algorithms Practical
04:02
New Parallel Algorithms Conclusion
04:21

Practical Data Structures for Concurrent Programming

8 lectures
Data Structures and Concurrency
07:37
Shared Pointer
09:03
Monitor Class
05:30
Monitor Class Continued
11:04
Semaphore
09:23
Concurrent Data Queue Practical
13:51
Thread Pools
05:14
Thread Pool Implementation Practical
06:54

Multithreading Resources

2 lectures
Recommended Book
00:17
Multithreading libraries
00:12

And finally...

1 lectures
Bonus Material
00:05

Đánh giá của học viên

Chưa có đánh giá
Course Rating
5
0%
4
0%
3
0%
2
0%
1
0%

Bình luận khách hàng

Viết Bình Luận

Bạn đánh giá khoá học này thế nào?

image

Đăng ký get khoá học Udemy - Unica - Gitiho giá chỉ 50k!

Get khoá học giá rẻ ngay trước khi bị fix.