YoVDO

Coroutines are Qt - Safer Thread Pools Interactions

Offered By: NDC Conferences via YouTube

Tags

NDC Conferences Courses Race Conditions Courses Asynchronous Programming Courses Coroutines Courses Thread Pool Courses

Course Description

Overview

Save Big on Coursera Plus. 7,000+ courses at $160 off. Limited Time Only!
Explore coroutines in Qt for safer thread pool interactions in this 52-minute conference talk. Learn how to solve common problems in asynchronous applications by offloading tasks to worker threads. Discover techniques to improve code readability, prevent race conditions, and handle object lifetimes effectively. Gain insights into using C++ 20 coroutines to write sequential syntax for asynchronous code, automatically migrate execution between threads, guard against race conditions, and ensure result storage validity. Follow along with a real-world Qt-based example and learn design principles for implementing coroutines in GUI applications. Understand the challenges of the ping-pong pattern and compare different approaches, including Qt's QObjects and nested lambdas. Dive into coroutine concepts, operations, and practical implementations in C++. Explore incremental steps to create a robust solution for thread pool interactions, including self-dispatching coroutines, automated lifetime checks, and guarding thread-unsafe pointers.

Syllabus

Intro
Outline
Motivation - The Ping-Pong Pattern
Challenges
Running Example: Remarks
Approach 1 - The Qt Way: Qobjects
Approach 2 - Nested Lambdas
Other Approaches
Coroutines - High-Level Overview
Coroutines - Supported Operations
Coroutines - Pseudo-Code
Coroutines in C++
C++ Coroutines - Notable Objects
C++ Coroutines - New Coroutine Operator
C++ Coroutines - Practical Example
C++ Coroutines - Awaitable Interface
C++ Coroutines - co_await on Awaitables
Design Principles
Proposed Solution - 4 Incremental Steps
Self-Dispatching Coroutines - Custom Await
Self-Dispatching Coroutines - Running Exa
Self-Dispatching Coroutines - Recap
Automate Lifetime Checks - Problem State
Automate Lifetime Checks - Example of Desir
Automate Lifetime Checks - Guard clas
Automate Lifetime Checks - Checked Await
Automate Lifetime Checks - Running Exar
2. Automate Lifetime Checks - Recap
Guarding Thread-Unsafe Pointers - Fronten
Guarding Thread-Unsafe Pointers - Improved
Guarding Thread-Unsafe Pointers - Swapp
Guarding Thread-Unsafe Pointers - Rec
Guarding Thread-Unsafe Pointers - Backen
Guarding Thread-Unsafe Pointers - Running
Guarding Thread-Unsafe Pointers - Expirit
Guarding Thread-Unsafe Pointers - ToThrea
Final Reworked Example
Final Design - Remarks
Hidden Costs


Taught by

NDC Conferences

Related Courses

Intermediate C# Scripting: Game Mechanics & Reusable Scripts
Packt via Coursera
Android Development Essential Training: Manage Data with Kotlin
LinkedIn Learning
Android Development: Retrofit with Kotlin
LinkedIn Learning
Android Development: Retrofit with Kotlin
LinkedIn Learning
Intermediate Kotlin for Android Developers
LinkedIn Learning