filmov
tv
Multithreading/Concurrency with C++ Threads - Creating, and Communicating with Background Threads

Показать описание
In this video we use the C++ threads library to accomplish a few different task with threads. We create a few worker threads, to break down some work into various parallel chunks. We look at how to run some heavier tasks in the background in short and long running threads, and also how to safely share data and communicate between threads using std::mutex, std::scoped_lock and std::conditional_variable.
00:00 - Intro
01:32 - C++ & CMake Setup
02:08 - Application Explanation
04:18 - Drawing Code
06:13 - Starting a std::thread
06:46 - join() and detach() an std::thread
07:56 - How many threads to create?
09:42 - Core utilization
10:08 - Using std::hardware_concurrency()
11:26 - Multithreaded drawing
15:15 - Saving data with a background thread
16:20 - Using detach()
16:57 - Using std::future and std::async
18:20 - std::mutex explanation
20:19 - Save data code
20:43 - std::scoped_lock explanation
23:23 - UI updates in a multithreaded application
25:49 - Quick explanation on deadlocks
27:03 - Loading data with a long running thread
29:17 - std::condition_variable explanation and usage
30:28 - std::unique_lock
Here's the code:
00:00 - Intro
01:32 - C++ & CMake Setup
02:08 - Application Explanation
04:18 - Drawing Code
06:13 - Starting a std::thread
06:46 - join() and detach() an std::thread
07:56 - How many threads to create?
09:42 - Core utilization
10:08 - Using std::hardware_concurrency()
11:26 - Multithreaded drawing
15:15 - Saving data with a background thread
16:20 - Using detach()
16:57 - Using std::future and std::async
18:20 - std::mutex explanation
20:19 - Save data code
20:43 - std::scoped_lock explanation
23:23 - UI updates in a multithreaded application
25:49 - Quick explanation on deadlocks
27:03 - Loading data with a long running thread
29:17 - std::condition_variable explanation and usage
30:28 - std::unique_lock
Here's the code:
Introduction To Threads (pthreads) | C Programming Tutorial
Multithreading/Concurrency with C++ Threads - Creating, and Communicating with Background Threads
An Introduction to Multithreading in C++20 - Anthony Williams - CppCon 2022
Threading Tutorial #1 - Concurrency, Threading and Parallelism Explained
Multithreading Is NOT What You Think
Threads in C++
Build your first multithreaded application - Introduction to multithreading in modern C++
how does a Mutex even work? (atoms in the computer??)
Multithreading Code - Computerphile
Concurrency Vs Parallelism!
FANG Interview Question | Process vs Thread
Multithreading
How to create and join threads in C (pthreads).
Multithreading for Beginners
First thread with std::thread | Introduction to Concurrency in C++
C# multithreading 🧶
How to write a multithreaded server in C (threads, sockets)
C# Multithreading - Master Threads and Tasks
Multi-Threading Programming in C
Something Is Weird About Rust's Threading and Concurrency | Rust Multi-Threading Tutorial
Asynchronous vs Multithreading and Multiprocessing Programming (The Main Difference)
Multithreading 101: Concurrency Primitives From Scratch - Arvid Gerstmann - Meeting C++ 2019
Basics of Concurrency, Threads, Process C++ | Multi Threading 1
What is a Thread? | Threads, Process, Program, Parallelism and Scheduler Explained | Geekific
Комментарии