Тёмный

Correcting Common Async/Await Mistakes in .NET 8 - Brandon Minnick - NDC Porto 2023 

NDC Conferences
Подписаться 198 тыс.
Просмотров 10 тыс.
50% 1

This talk was recorded at NDC Porto in Porto, Portugal. #ndcporto #ndcconferences #dotnet #concurrency #softwaredeveloper
Attend the next NDC conference near you:
ndcconferences...
ndcporto.com/
Subscribe to our RU-vid channel and learn every day:
/‪@NDC‬
Follow us on our Social Media:
/ ndcconferences
/ ndc_conferences
/ ndc_conferences
Did you know that the .NET compiler turns our async methods into classes? And that .NET adds a try/catch block to each of these classes, potentially hiding thrown exceptions? It's true!
In this session, we will learn how to best use async/await in C# by analyzing how .NET compiles our async code.
Join me as we take an existing app and optimize its async code together, showing off performance gains, better exception handling, improved run-time speed, and smaller app size!

Опубликовано:

 

4 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 18   
@janjoska2549
@janjoska2549 9 месяцев назад
There is no thread, neo
@chrisevans9629
@chrisevans9629 9 месяцев назад
A task really is just work that will be completed at a later time. In some contexts, it may not run on a different thread in the thread pool, although thread switching is the most common scenario. It never creates a thread as far as I am aware, but just cycles through the thread pool. Additionally, the primary goal of async/await is to free up the UI and to make background tasks easier, which is a different problem than parallel processing with different design considerations.
@VoroninPavel
@VoroninPavel 9 месяцев назад
> It never creates a thread as far as I am aware. Depends on the scheduler. In theory TaskCreationOptions.LongRunning signals to the scheduler that creating a new thread is desirable.
@PlerbyMcFlerb
@PlerbyMcFlerb Месяц назад
I don't think its primary goal is to get off the ui thread. It's more about being able to write procedural style code, but still have it behave async. Take aspnet core for example. Tasks are used to use fewer threads and increase scalability. A totally different usecase than escaping some primary thread.
@exciting-burp
@exciting-burp 9 месяцев назад
Missed the biggest problem with async void: unhandled exceptions will bring the entire process down (depending on the synchronization context).
@yehudak1646
@yehudak1646 7 месяцев назад
Very useful information, Tank you very much.
@jeffsherman9638
@jeffsherman9638 8 месяцев назад
Thanks for sharing!
@Onyxagargaryll
@Onyxagargaryll 9 месяцев назад
Great talk! How is the "available thread" chosen? Does .NET have a scheduler for this?
@turbosega
@turbosega 9 месяцев назад
Nice!
@Animalfarm635
@Animalfarm635 9 месяцев назад
Hello good morning
@PlerbyMcFlerb
@PlerbyMcFlerb Месяц назад
Kinda blown away this talk is given this way. Oodles of misinformation. Is there really no one to check this talk? Ndc needs some sort of peer review system
@gregh2327
@gregh2327 9 месяцев назад
Brandon seems like a nice, friendly guy; but this talk on async/await that he keeps doing is flimsy at best and dangerous at worst. The conflation of threads and tasks being the most egregious mistake. “There’s a threadpool. We don’t have time to dive into it today” leads to so much bad, async code. Unfortunately, async/await is advanced stuff and hand waving the complexity away is problematic.
@oralitical
@oralitical 9 месяцев назад
Out of curiosity. Is there any resource you would recommend? I'd love to learn more about async/await specifically since it's such an abstract concept.
@djchrisi
@djchrisi 9 месяцев назад
@@oraliticalI think the post "There Is No Thread" from Stephen Cleary is a good start.
@PlerbyMcFlerb
@PlerbyMcFlerb Месяц назад
The number of times the term background thread is incorrectly invoked in this talk is frightening. I remember having this naive mental model, so no shame in not knowing everything, but I didn't have the hubris to give talks about it.
@tarsala1995
@tarsala1995 8 месяцев назад
You cannot say that value types are leaving in the stack. It's a big oversimplification
Далее
НЕ БУДИТЕ КОТЯТ#cat
00:21
Просмотров 944 тыс.
Don't Use Polly in .NET Directly. Use this instead!
14:58