Writing async/await from scratch in C# with Stephen Toub

  Рет қаралды 89,683

dotnet

dotnet

Күн бұрын

Join Stephen Toub and Scott Hanselman as they dive deep into the world of .NET. On this first episode, Stephen and Scott demystify the world of asynchronous programing with .NET and specifically the magic behind async/await, something that developers use every day. To do so, he builds his very own implementation of async/await completely from scratch and explains throughout the way. If you are looking to go deeper with .NET then you are in the right place.
Chapters:
00:00 - Intro
03:00 - Understanding concurrency, parallelism, and asynchronous
08:30 - Creating our own ThreadPool
26:00 - Creating our own Task
45:30 - Putting together ThreadPool and Tasks
56:00 - Async iterators and yield
01:05:00 - Wrap-up
Resources:
Blog: devblogs.microsoft.com/dotnet...
Docs: learn.microsoft.com/dotnet/cs...
Final Code: gist.github.com/jamesmontemag...
Connect with .NET:
Blog: aka.ms/dotnet/blog
Twitter: aka.ms/dotnet/twitter
TikTok: aka.ms/dotnet/tiktok
Mastodon: aka.ms/dotnet/mastodon
LinkedIn: aka.ms/dotnet/linkedin
Facebook: aka.ms/dotnet/facebook
Docs: learn.microsoft.com/dotnet
Forums: aka.ms/dotnet/forums
🙋‍♀️Q&A: aka.ms/dotnet-qa
👨‍🎓Microsoft Learn: aka.ms/learndotnet
#dotnet #asyncawait #csharp

Пікірлер: 208
@majixx
@majixx Ай бұрын
Stephen Toub is an absolute treasure for all .NET developers. We defiantly need more content from him. What a great orator and teacher!!
@FilipCordas
@FilipCordas Ай бұрын
You have to give credit to Hanselman as well he is the best at preventing not to know anything when in fact he is probably as knowledgeable as Stephen.
@davecenter2002
@davecenter2002 Ай бұрын
I love Hanselman and he’s fantastic, but he absolutely is nowhere close to as knowledgeable as Stephen.
@shanselman
@shanselman Ай бұрын
@@davecenter2002can confirm. We have different jobs. Plus he kinda wrote the thing. 😂
@michaltomorowicz596
@michaltomorowicz596 Ай бұрын
when you have two legends in one vid, debating who is a bigger legend is like arguing which type of sugar is sweeter :D awesome content
@san30911
@san30911 Ай бұрын
Totally. He made me fall in love with C#...
@elerius2
@elerius2 Ай бұрын
More of this, please! Feels like a channel9 video from back in the day.
@dotnet
@dotnet Ай бұрын
Oh we got more!!!
@theFijian
@theFijian Ай бұрын
Lol Channel9 really does feel like "back in the day" 🤣
@vacc1001
@vacc1001 Ай бұрын
@@dotnet Is there a place where I can find more videos like this?
@dotnet
@dotnet Ай бұрын
@@vacc1001 We are releasing more and more. Subscribe and checkout the playlist: kzbin.info/aero/PLdo4fOcmZ0oX8eqDkSw4hH9cSehrGgdr1
@tomglenn6019
@tomglenn6019 Ай бұрын
I was already very familiar with how tasks/async/await work under the covers but seeing Stephen effortlessly "reimplement" it without copying and pasting or using notes is a humble masterclass of intellectual horsepower.
@Daysra
@Daysra Ай бұрын
Can I just say how great this duo is. Stephen is awesome at explaining things to a great depth, and Scott knows exactly where to stop and ask for clarifications, at an extent that hits just the sweet spot for me, not being too much. More videos from this duo please.
@s.hosseinhosseini8330
@s.hosseinhosseini8330 Ай бұрын
This was amazing. Why I love this? 1. Scott Hanselman 2. Stephen Toub 3. An actual deep dive into a concept with a high-quality explanation of it.
@computer9764
@computer9764 Ай бұрын
3.1. It didn't have a ridiculous thumbnail.
@gpltaylor
@gpltaylor Ай бұрын
When I say that I have watched every video and read every article about async and await, I am not exaggerating. However not a single one has come close to educating what this does, why and how to use it and how this is implemented as this does. This is one of the best videos I have seen on this subject. I would love to see more videos like this, that deep dive into the technical rather than floating around at surface level
@ghostg6107
@ghostg6107 29 күн бұрын
Kevin Gosse also did a deep dive on async await. Stephen Cleary has a walkthrough of the history of Task.
@tedchirvasiu
@tedchirvasiu Ай бұрын
I love how Scott asks all the right questions.
@shanselman
@shanselman Ай бұрын
@Anubis_moe
@Anubis_moe Ай бұрын
Wow we need more topic like this please. We need more of .net core internals
@dotnet
@dotnet Ай бұрын
Oh we have more!!!!!
@umarahmad3705
@umarahmad3705 Ай бұрын
Looking forward to more ​@@dotnet
@umarahmad3705
@umarahmad3705 Ай бұрын
​@@dotnetor do you already have a playlist with topics like this
@umarahmad3705
@umarahmad3705 Ай бұрын
Strongly agree
@ThorstenSauter
@ThorstenSauter Ай бұрын
This was an absolute delight to watch. Thank you Stephen and Scott!
@CecilPhillip
@CecilPhillip Ай бұрын
Great video. Would love to see a dive into IAsyncEnumerable implementations
@dotnet
@dotnet Ай бұрын
Thanks for the idea! Hope you are doing well Cecil 💖
@ChaseFreedomMusician
@ChaseFreedomMusician Ай бұрын
@@dotnet I would love to see an example implementation of IQueryable, it is so non-approachable even for simple tasks, but it is an incredibly powerful feature.
@WespazjansDad
@WespazjansDad Ай бұрын
Superb stuff. Scott leads it well, without interrupting too much. And Stephen delivers pure meat. That is one of these few precious resources that despite the fact they last for ah hour, I personally need a few hours to analyze, rewind and make sure all these topics really click in my head.
@runtimmytimer
@runtimmytimer Ай бұрын
Love this deep dive stuff. Too much 101 content and almost zero 400 content.
@ArnonDanon
@ArnonDanon Ай бұрын
Scott & Stephen rewriting async await reminded me David & Damian rewriting SignalR on stage. All dotnet devs out there are standing on the shoulders of Giants🙏🏼 This is great content
@metaturso
@metaturso Ай бұрын
Link please?
@pmnm113
@pmnm113 Ай бұрын
after watching this I am youtubing about Stephen Toub videos. We need more content from him. I was nice to see low level design of async await here. thanks!
@MatthiWare
@MatthiWare Ай бұрын
Amazing video! I would love to see more content like this.
@cheekychappy1234
@cheekychappy1234 13 күн бұрын
Such a fantastic video! Keep producing more and don't be afraid to dive deeper and deeper.
@JSWarcrimes
@JSWarcrimes Ай бұрын
Now this is some premium content.
@bity-bite
@bity-bite Ай бұрын
Great video! I love this style of rewriting stuff to explain how it works internally. We'd love more videos like this one
@DannysGalaxyTab
@DannysGalaxyTab Ай бұрын
What a great video idea. Great hosts to listen to as well.
@zksward
@zksward Ай бұрын
Really love to see this kind of in depth content coming from the team. We need mooooore!
@fullemptiness
@fullemptiness Ай бұрын
What a great idea to teach such a complex topic! It's like you found the missing piece in my (most .NET devs?) understanding to async programming!... Please do a series on async programming like this episode. Thanks!
@acedonk
@acedonk Ай бұрын
This was a masterclass, thanks!
@minimalistdeveloper
@minimalistdeveloper Ай бұрын
Loved this. This is the video equivalent of Csharp in Depth and CLR via Csharp. Kindly do more of these level 300 topics.
@CraigShearer
@CraigShearer Ай бұрын
Great info. Been away from C# for a few years, but nice to see this detailed as to how async/await works.
@FXK23
@FXK23 Ай бұрын
Definitely going to watch this again and code along. Excellent video!
@paaabl0.
@paaabl0. Ай бұрын
Brilliant demo! Thank you guys!
@codewithkhondamir
@codewithkhondamir Ай бұрын
That’s amazing. Thanks Scott and Stephen.
@fredyjimenez4853
@fredyjimenez4853 Ай бұрын
This is best explanation to fully understand async/await. Greate quality content Kudos to Scott and Stephen
@StephenGierek
@StephenGierek Ай бұрын
This was really great! I've always struggled wrapping my head around how async/await works, but this method of instruction is extremely effective in conveying what's going on under the hood. Please, more like this. I could watch these all day long. 🙂
@ChaseFreedomMusician
@ChaseFreedomMusician Ай бұрын
This is by far one of my favorite videos to-date.
@Hereson
@Hereson Ай бұрын
Amazing explanation, please do more of these!
@pachanga5382
@pachanga5382 Ай бұрын
Excellent video-I was wondering at first why I needed to know this, and now I know!
@SlackwareNVM
@SlackwareNVM Ай бұрын
This was fantastic! I'd love a couple of more episodes that go into the optimizations that can be layered on top of this implementation.
@--Eric--
@--Eric-- Ай бұрын
Thanks Stephen and Scott, this was a great session. More please... 👏🏼
@VukManic
@VukManic Ай бұрын
What an amazing video! This is one of best video to understand async await!!!! Thanks to both of you! Really enjoyed it!
@moke_codes
@moke_codes Ай бұрын
This was amazing! I wish we could see more advanced topics like this. Learned a lot! Thanks guys!
@krccmsitp2884
@krccmsitp2884 Ай бұрын
Amazing! Thanks to both of you! 🙂
@vedantkoditkar5968
@vedantkoditkar5968 Ай бұрын
If only there is a way to give million up vote to this video. I always look forwards to Stephen Toub videos, his explanation is top notch.
@stevanfreeborn
@stevanfreeborn Ай бұрын
Thank you for making this! 🙏🏻
@fifty6737
@fifty6737 Ай бұрын
awesome video, always pleasure to listen to stephen
@neeleshbodgal7479
@neeleshbodgal7479 Ай бұрын
That helps to understand more and better about the Task API. Stephen Toub blogs are worth reading that always teach me something new 😀
@robl39
@robl39 Ай бұрын
Now get David Fowler to write Kestrel from scratch. I’d love to see that.
@v001
@v001 Ай бұрын
Stephen Toub is a legend! great talk, need more of this
@papafe
@papafe Ай бұрын
Super interesting! I think it would be interesting also to dive deep into SynchronizationContext and how it relates to the ExecutionContext that was shown in the video
@danfriedman7009
@danfriedman7009 18 күн бұрын
Immensely helpful. You guys rocked this presentation. Can't wait to watch the LINQ videos (and I hope there is more on the way).
@emiraksoy1520
@emiraksoy1520 Ай бұрын
This was amazing we want more content with Steve 💯💯
@mambocollective
@mambocollective Ай бұрын
Great video. Learnt so much from this. Definitely need more content like this, especially with Stephen. It worked so well with him leading the way and then you pulling him back with questions I had in my own head. Looking forward to more of this sort of content.🤩
@RickJohnn
@RickJohnn Ай бұрын
Excellent from start to finish.
@SharpGIS
@SharpGIS Ай бұрын
Loved this. Please do more Level 3-400 content!
@damianpio1443
@damianpio1443 Ай бұрын
Loved this video, hope we will get more of these
@DotNetRyanYT
@DotNetRyanYT Ай бұрын
Thanks for this. Async/await was always a black box to me, but now I feel I have lifted the lid on the box and took a look inside.
@imranhussain8700
@imranhussain8700 Ай бұрын
This is some crazy stuff. Stephen Toub is amazing. Scott Hanselman has done a fantastic job as usual for the viewers to ensure the topic is covered as much in depth as possible. Thank you very much. We need morrrrrrrrrrrrrrreeeeeeeeeeeeeeeeeee of these for sure.
@TheProTip
@TheProTip Ай бұрын
This is great. I've never actually heard Stephen talk though I've read a bunch of his perf reports and other posts. He presents very well.
@sudeshryan8707
@sudeshryan8707 Ай бұрын
This is gem of a tutorial. Thanks guys
@danielvillalba4457
@danielvillalba4457 Ай бұрын
Wow, just amazing information and even better way to explain it! Thanks
@chenc671
@chenc671 Ай бұрын
Wow, It was a Master piece when the await works at the end !
@kRySt4LGaMeR
@kRySt4LGaMeR 17 күн бұрын
Watching Stephen doing this is amazing. Scott on the other hand has extremely lack luster contributions.
@paulecampbell
@paulecampbell Ай бұрын
Stephen is on another level!
@thedanielspindler
@thedanielspindler Ай бұрын
Loved this. Amazing! Now I just need to re-watch it another 5 times at 0.5 speed to really soak it all in.
@sjark5000
@sjark5000 7 күн бұрын
This is just fantastic content, more of this please :)
@SajadJalilian
@SajadJalilian Ай бұрын
We really need Stephen do more live coding. He is really good at delivering what he does
@michaltomorowicz596
@michaltomorowicz596 Ай бұрын
What a great material guys, massive kudos.
@giovannimorleschi1750
@giovannimorleschi1750 21 күн бұрын
Awesom, semply awesom, you have to do a lot of this video please! Stephen Tuob, you are ten thousand time better then the better professor in tis solar system!
@northshorepx
@northshorepx Ай бұрын
That was a really great tutorial. Seeing how everything is continuations all the way down was incredibly eye opening. I'd love to see more details like this please. However I have one small nitpick, that of Stephen constantly making the font way too small to read. Scott kept picking him up on it, but it's really important for us who are watching to be able the read the code that they're writing and thus for presenters to realise how video tutorials need zoomed up fonts.
@wolfgangdiemer2511
@wolfgangdiemer2511 Ай бұрын
Thank you very much, awesome content
@DOTNETMAN
@DOTNETMAN Ай бұрын
The Legends of .NET.
@KenRossPhotography
@KenRossPhotography Ай бұрын
Awesome video - so many great nuggets here. Even if you think you *know* async/await, you'll get value from watching this (maybe more than once) 🙂
@unknown.artist.track3
@unknown.artist.track3 21 күн бұрын
I had already bookmarked your article from dev blog about async await)))
@BryanKelly
@BryanKelly Ай бұрын
First, I loved this video. Just everything about it was good. I would love a follow up to cover: 1. more of the async/await keywords (the stuff you were getting to at the very end) 2. Why doing the "bad" things is bad. (ex. .Result, and others I'm failing to think of now) 3. Async enumerable
@theFoodieCyclist
@theFoodieCyclist Ай бұрын
Loved it! You guys are awesome!
@AslamNazeerShaikh
@AslamNazeerShaikh Ай бұрын
Please make videos on "cancellation token"
@zakizaz1
@zakizaz1 Ай бұрын
Great content . Thank you
@thishandleistaken
@thishandleistaken Ай бұрын
Amazing video! Thanks!
@jackkendall6420
@jackkendall6420 Ай бұрын
This was incredibly good.
@MatteoGariglio
@MatteoGariglio 23 күн бұрын
I wish I watched this video long time ago 😅. Thank you so much Stephen, the explanations are really instructive.
@rasmussoeborg450
@rasmussoeborg450 Ай бұрын
Very informative - Great explanation
@stephajn
@stephajn Ай бұрын
Like Admiral Kirk said to Saavik in Wrath of Khan, “You have to know WHY things work on a starship.” This was definitely really cool to watch and follow! Gonna have to watch it again on a PC as opposed to my iPad, but it is well worth it!
@timeless-sg
@timeless-sg Ай бұрын
EXCELLENT. THANK YOU STEPHEN.
@jimiscott
@jimiscott Ай бұрын
This is superb.
@user-we2gj9uz7r
@user-we2gj9uz7r Ай бұрын
Excellent content! Thank you!
@rafaelfelipe3986
@rafaelfelipe3986 Ай бұрын
Amazing content. Thank you so much for that.
@sachinvshishth
@sachinvshishth Ай бұрын
Thank you for the insightful session. Just a quick request: could you please utilize the dark theme whenever feasible?
@azarthi
@azarthi Ай бұрын
Love this super easy to follow!
@PhoenixCustomerInsights
@PhoenixCustomerInsights Ай бұрын
I would love to strive for that clarity of knowledge in tasks. I'm holding on to this video for another review and letting it wash over me a few times. Could there be a continuation in the parallel processing of tasks, comparing concurrency and parallel execution of Tasks?
@brechtlaitem
@brechtlaitem Ай бұрын
We want more, we want more!!
@dotnet
@dotnet Ай бұрын
We are making more right now!!!!!!!!!!!!!!!!
@semihartan
@semihartan Ай бұрын
Amazing presentation. Thank you both!
@obinnaokafor6252
@obinnaokafor6252 Ай бұрын
Scott and Stephen should do videos on Tensor Primitives in dotnet. And other ML types and improvements in dotnet and C#
@shanselman
@shanselman Ай бұрын
Totally!
@tarun-hacker
@tarun-hacker Ай бұрын
Stephen Toub is awesome.
@LILogisticaIntegrada
@LILogisticaIntegrada Ай бұрын
Thanks for this!
@aptypp
@aptypp Ай бұрын
Thanks for video!
@shadowspyes
@shadowspyes Ай бұрын
please more high detail low level videos like this!
@karthiks4347
@karthiks4347 10 күн бұрын
Simply great!!👍
@Dotnetawy
@Dotnetawy Ай бұрын
Awesome 👌
@dealsman
@dealsman 16 күн бұрын
Intense! Both of you!
@tiZyJoshi
@tiZyJoshi Ай бұрын
this was awesome, ty!
@Rolan18111
@Rolan18111 Ай бұрын
Excellent video - that certainly removed a lof of the "ghosts in the machine" feel of async/await. I feel like de-implementing syntactic sugar would be another good video topic. Take some modern c# code and replace all the syntactic sugar with the underlying implementations. And/Or show how you can look up the underlying implementations quickly & easily.
@familienmitic6623
@familienmitic6623 Ай бұрын
Scott is just awesome
@ralmslb
@ralmslb 8 күн бұрын
This one deserved a part 1 and part 2, to better go on a slower pace around the await keyword, etc. Felt that was mostly just around Tasks, that is inherently to async await, but still, doesn't allow to have a good peak on await functionality and nuances.
@tedchirvasiu
@tedchirvasiu Ай бұрын
Wow, just as I needed this
@MatPolutta
@MatPolutta Ай бұрын
I needed this. Thanks
@MatPolutta
@MatPolutta 23 күн бұрын
Just watched a 2nd time. Almost there. 3rd time is the charm? Let's hope.
Deep Dive on LINQ with Stephen Toub
1:23:59
dotnet
Рет қаралды 45 М.
когда одна дома // EVA mash
00:51
EVA mash
Рет қаралды 13 МЛН
маленький брат прыгает в бассейн
00:15
GL Show Russian
Рет қаралды 4,4 МЛН
Follow @karina-kola please 🙏🥺
00:21
Andrey Grechka
Рет қаралды 22 МЛН
A Complete .NET Developer's Guide to Span with Stephen Toub
1:02:48
So You Think You Know Git - FOSDEM 2024
47:00
GitButler
Рет қаралды 933 М.
Deep Dive into RegEx with Stephen Toub
1:09:31
dotnet
Рет қаралды 14 М.
Clean Architecture with ASP.NET Core 8 | .NET Conf 2023
29:17
Working with Channels in .NET
27:41
dotnet
Рет қаралды 29 М.
Meet .NET Aspire
2:13
dotnet
Рет қаралды 8 М.
📱 SAMSUNG, ЧТО С ЛИЦОМ? 🤡
0:46
Яблочный Маньяк
Рет қаралды 1,3 МЛН
Эффект Карбонаро и бумажный телефон
1:01
История одного вокалиста
Рет қаралды 2,4 МЛН
На iPhone можно фоткать даже ночью😳
0:30
GStore Mobile
Рет қаралды 1,4 МЛН