World Congress 2022 Jun 15, 2022

Asynchronicity and multithreading in C#

Grzegorz Lang

Are you still manually spawning threads in C#? Discover why blocking threads kills performance and how mastering modern async/await patterns maximizes server throughput.

Pause
Mute Enter Fullscreen
#1 about 4 min

Multithreading basics and physical versus logical threads

Multithreading handles CPU-intensive work by delegating calculations to limited physical and logical worker threads.

#2 about 2 min

Managing thread allocation using the dotnet thread pool

The dotnet thread pool prevents system overload by managing thread lifecycle and task abstractions.

#3 about 2 min

Avoiding blocked threads during ongoing background calculations

Using synchronous result properties freezes physical threads instead of safely continuing execution after task completion.

#4 about 2 min

Recommended abstractions for starting tasks and background work

Defaulting to modern task abstractions prevents common thread initialization mistakes and configuration errors.

#5 about 2 min

Implementing cancellation tokens to terminate long running operations

Cancellation tokens safely interrupt background services and clean up allocated resources upon request.

#6 about 3 min

Synchronizing background calculations with user interface rendering contexts

Synchronization contexts ensure that background thread calculations safely update interface components on the primary environment thread.

#7 about 2 min

Using task schedulers to route background thread execution

Task schedulers collaborate with environment contexts to determine where and how asynchronous operations execute.

#8 about 4 min

Avoiding locked resources during database and network requests

Asynchronous patterns release threads to the pool during input and output delays instead of waiting idle.

#9 about 3 min

Compiler state machines and asynchronous concurrent task execution

The compiler transforms asynchronous methods into state machines that easily resume task execution upon network completion.

#10 about 1 min

Preventing hidden errors by avoiding asynchronous void return types

Asynchronous methods lacking a measurable return type swallow exceptions and prevent accurate execution tracking.

#11 about 2 min

Reducing heap allocations by implementing value task structures

Value tasks optimize execution paths by avoiding heap allocations during highly frequent concurrent calculations.

#12 about 2 min

Modifying asynchronous synchronization context configurations for software libraries

Disabling context capture in background tasks ensures agnostic library environments without unnecessary interface thread coupling.

#13 about 4 min

Clarifying asynchronous patterns and modern framework implementation differences

Understanding synchronization context changes in modern frameworks helps mitigate common thread blocking mistakes during implementation.

Matching moments

4:13 min

Awaiting async void methods with custom task schedulers

Adam Furmanek · LIVE

3:57 min

Enforcing performant threading models at the framework level

Xuan Huang Xuan Huang · WWC 2025

1:34 min

Shift away from traditional threads and the asynchronous era

Ivan Šarić Ivan Šarić · Europe 2026 Virtual

5:10 min

Audience Q&A on arrow functions and multithreading

Rob Richardson · JS Congress

3:32 min

Managing asynchronous operations and concurrent multithreading with isolates

Christoph Christoph · WWC 2024

4:16 min

Implementing cooperative multitasking in modern programming languages

Mikhail Maslo · WWC 2023

Upcoming sessions on this topic

Open session

World Congress 2026 North America

When Humans Stop Writing Code: Rethinking Languages, Compilers, and Responsibility

Simon Auer

Organizer of flutter vienna meetup and CEO of marqably

Simon Auer
Open session

World Congress 2026 North America

How to generate business value through performance optimizations

Nikolai Sidiropulo

Software Engineer at Meta

Nikolai Sidiropulo
Open session

World Congress 2026 North America

Offloading IoT State: Solving the Memory Crisis on Legacy Hardware

Pravin Nagare

Senior Software Engineer, Roku

Pravin Nagare
Open session

World Congress 2026 North America

public void saveMoney(AI): The Developer's Guide to Unit Economics

Hrushikesh Pokala

Senior Software Engineer Lead at Equifax

Hrushikesh Pokala
Open session

World Congress 2026 North America

Designing APIs That Survive AI Agents at Scale

Phani Pendurthi

Mastercard, Principal Software Engineer

Phani Pendurthi
Open session

World Congress 2026 North America

Merging at Scale: From Broken Builds to Green Mainline

Manjari Akella, Preetam Dwivedi

Manjari Akella
Preetam Dwivedi