SlideShare a Scribd company logo
No More Deadlocks; Asynchronous Programming in .NET
Author. Blogger. Speaker. .NET MVP. Xamarin MVP. Geek.
Senior Software Engineer @
No More Deadlocks; Asynchronous Programming in .NET
No More Deadlocks; Asynchronous Programming in .NET
12:38
No More Deadlocks; Asynchronous Programming in .NET
No More Deadlocks; Asynchronous Programming in .NET
No More Deadlocks; Asynchronous Programming in .NET
No More Deadlocks; Asynchronous Programming in .NET
var task = Task.Run(() => {
Thread.Sleep(2000);
return "Hello World!";
});
task.ContinueWith((completedTask) => {
Dispatcher.Invoke(() => MyButton.Content = completedTask.Result);
});
Task.Delay(1).ContinueWith((t) => {
Dispatcher.Invoke(() => { });
}).Wait();
No More Deadlocks; Asynchronous Programming in .NET
No More Deadlocks; Asynchronous Programming in .NET
No More Deadlocks; Asynchronous Programming in .NET
No More Deadlocks; Asynchronous Programming in .NET
UsingAsyncandAwait
No More Deadlocks; Asynchronous Programming in .NET
private async Task RunAsync()
{
var x = 10;
await Task.Delay(2000);
Debug.WriteLine(x);
}
private Task RunAsync()
{
<RunAsync>d__1 stateMachine = new <RunAsync>d__1 {
<>t__builder = AsyncTaskMethodBuilder.Create(),
<>1__state = -1
};
stateMachine.<>t__builder.Start<<RunAsync>d__1>(ref stateMachine);
return stateMachine.<>t__builder.Task;
}
Deadlockallthethings!
No More Deadlocks; Asynchronous Programming in .NET
No More Deadlocks; Asynchronous Programming in .NET
Author. Blogger. Speaker. .NET MVP. Xamarin MVP. Geek.
Senior Software Engineer @

More Related Content

PPTX
Asynchronous programming
PPTX
Asynchronous programming from Xamarin Hakcday in Melbourne
PDF
Automation in angular js
PPTX
Game Analytics Cluster Scheduler
PPTX
Correcting Common Async/Await Mistakes in .NET
PPTX
Introduction to Service Workers | Matteo Manchi
PPTX
Rxjs ngvikings
PPTX
Rxjs swetugg
Asynchronous programming
Asynchronous programming from Xamarin Hakcday in Melbourne
Automation in angular js
Game Analytics Cluster Scheduler
Correcting Common Async/Await Mistakes in .NET
Introduction to Service Workers | Matteo Manchi
Rxjs ngvikings
Rxjs swetugg

What's hot (20)

PPTX
Correcting Common .NET Async/Await Mistakes
PDF
Rxjs vienna
PPTX
PDF
Fetch data from form
PDF
Python in the database
PPTX
Understanding reactive programming with microsoft reactive extensions
PDF
React native-firebase startup-mtup
 
PDF
Rntb20200805
 
PPTX
Coolblue - Behind the Scenes Continuous Integration & Deployment
PPTX
Alt.Net Presentation
PDF
Sbt for mere mortals
PDF
Trisha gee concurrentprogrammingusingthedisruptor
PDF
Why Redux-Observable?
PPTX
Azure sql insert perf
PDF
Implement Mapreduce with suitable example using MongoDB.
PDF
GPars For Beginners
PDF
Monitoring und Metriken im Wunderland
 
PDF
Do something in 5 with gas 4- Get your analytics profiles to a spreadsheet
PDF
DOT NET LAB PROGRAM PERIYAR UNIVERSITY
PDF
Async JavaScript in ES7
Correcting Common .NET Async/Await Mistakes
Rxjs vienna
Fetch data from form
Python in the database
Understanding reactive programming with microsoft reactive extensions
React native-firebase startup-mtup
 
Rntb20200805
 
Coolblue - Behind the Scenes Continuous Integration & Deployment
Alt.Net Presentation
Sbt for mere mortals
Trisha gee concurrentprogrammingusingthedisruptor
Why Redux-Observable?
Azure sql insert perf
Implement Mapreduce with suitable example using MongoDB.
GPars For Beginners
Monitoring und Metriken im Wunderland
 
Do something in 5 with gas 4- Get your analytics profiles to a spreadsheet
DOT NET LAB PROGRAM PERIYAR UNIVERSITY
Async JavaScript in ES7
Ad

Viewers also liked (6)

PPTX
C# Is The Future
PPTX
Azure Mobile Services .NET Backend
PPTX
C# 6.0 - What?! C# is being updated?
PPTX
Async and parallel patterns and application design - TechDays2013 NL
PPTX
Async Programming with C#5: Basics and Pitfalls
PPTX
Asynchronous programming in ASP.NET
C# Is The Future
Azure Mobile Services .NET Backend
C# 6.0 - What?! C# is being updated?
Async and parallel patterns and application design - TechDays2013 NL
Async Programming with C#5: Basics and Pitfalls
Asynchronous programming in ASP.NET
Ad

Similar to No More Deadlocks; Asynchronous Programming in .NET (20)

PPTX
Windows Phone 8 - 3.5 Async Programming
PPTX
.NET Core Summer event 2019 in Brno, CZ - Async demystified -- Karel Zikmund
PPTX
The 3 VS Threading Rules
PPTX
Task parallel library presentation
PPSX
await Xamarin @ PTXug
PDF
Async Await for Mobile Apps
PDF
Using Async in your Mobile Apps - Marek Safar
PPTX
NDC Sydney 2019 - Async Demystified -- Karel Zikmund
PDF
Async Debugging A Practical Guide to survive !
PDF
Android Threading
PPTX
Workshop: Async and Parallel in C#
PDF
.NET Multithreading and File I/O
PPTX
History of asynchronous in .NET
PPTX
Async Programming in C# 5
PDF
Async Debugging - A Practical Guide to survive !
PDF
.NET Fest 2018. Владимир Крамар. Многопоточное и асинхронное программирование...
PPTX
The zen of async: Best practices for best performance
PPSX
Async-await best practices in 10 minutes
PPTX
Async Best Practices
PPT
C# Async on iOS and Android - Craig Dunn, Developer Evangelist at Xamarin
Windows Phone 8 - 3.5 Async Programming
.NET Core Summer event 2019 in Brno, CZ - Async demystified -- Karel Zikmund
The 3 VS Threading Rules
Task parallel library presentation
await Xamarin @ PTXug
Async Await for Mobile Apps
Using Async in your Mobile Apps - Marek Safar
NDC Sydney 2019 - Async Demystified -- Karel Zikmund
Async Debugging A Practical Guide to survive !
Android Threading
Workshop: Async and Parallel in C#
.NET Multithreading and File I/O
History of asynchronous in .NET
Async Programming in C# 5
Async Debugging - A Practical Guide to survive !
.NET Fest 2018. Владимир Крамар. Многопоточное и асинхронное программирование...
The zen of async: Best practices for best performance
Async-await best practices in 10 minutes
Async Best Practices
C# Async on iOS and Android - Craig Dunn, Developer Evangelist at Xamarin

Recently uploaded (20)

PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
madgavkar20181017ppt McKinsey Presentation.pdf
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Electronic commerce courselecture one. Pdf
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Modernizing your data center with Dell and AMD
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Sensors and Actuators in IoT Systems using pdf
PDF
cuic standard and advanced reporting.pdf
PPTX
MYSQL Presentation for SQL database connectivity
PDF
solutions_manual_-_materials___processing_in_manufacturing__demargo_.pdf
PDF
GDG Cloud Iasi [PUBLIC] Florian Blaga - Unveiling the Evolution of Cybersecur...
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Advanced Soft Computing BINUS July 2025.pdf
PPTX
Big Data Technologies - Introduction.pptx
PPTX
breach-and-attack-simulation-cybersecurity-india-chennai-defenderrabbit-2025....
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
KodekX | Application Modernization Development
PDF
Chapter 3 Spatial Domain Image Processing.pdf
“AI and Expert System Decision Support & Business Intelligence Systems”
madgavkar20181017ppt McKinsey Presentation.pdf
Understanding_Digital_Forensics_Presentation.pptx
NewMind AI Weekly Chronicles - August'25 Week I
Electronic commerce courselecture one. Pdf
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Modernizing your data center with Dell and AMD
Dropbox Q2 2025 Financial Results & Investor Presentation
Sensors and Actuators in IoT Systems using pdf
cuic standard and advanced reporting.pdf
MYSQL Presentation for SQL database connectivity
solutions_manual_-_materials___processing_in_manufacturing__demargo_.pdf
GDG Cloud Iasi [PUBLIC] Florian Blaga - Unveiling the Evolution of Cybersecur...
Spectral efficient network and resource selection model in 5G networks
Advanced Soft Computing BINUS July 2025.pdf
Big Data Technologies - Introduction.pptx
breach-and-attack-simulation-cybersecurity-india-chennai-defenderrabbit-2025....
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
KodekX | Application Modernization Development
Chapter 3 Spatial Domain Image Processing.pdf

No More Deadlocks; Asynchronous Programming in .NET