C# Async/Await/Task Explained (Deep Dive)

Share this & earn $10
Raw Coding
Published at : 20 Dec 2020
122091 views
4187
107

In this tutorial we conver the asynchronous programming style in C# we take a deep diving looking at the state machine that the async keyword spawns. How the await keyword creates checkpoints in the state machine. And how the Task class allows us to bridge our code to use the asynchronous programming model.

Source: https://github.com/T0shik/raw-coding-101-tutorials/tree/master/Async%20Await%20Task

I know this topic can be confusing, here is more material on the topic

Videos
Karel Zikmund https://www.youtube.com/watch?v=TgUYcZV-foM
Jeffrey Richter https://www.youtube.com/watch?v=T9UTfymRZXU
Jeffrey Richter (with Demo at 41:55) https://www.youtube.com/watch?v=hB0K1JWFoqs
Adam Krieger (Good info on Thread Pool) https://www.youtube.com/watch?v=NnZCcvAdV_4

Articles
https://devblogs.microsoft.com/premier-developer/dissecting-the-async-methods-in-c/
https://www.codeproject.com/Articles/535635/Async-Await-and-the-Generated-StateMachine
https://ranjeet.dev/understanding-how-async-state-machine-works/

Social:
Twitch: https://www.twitch.tv/raw_coding
Discord: https://discord.gg/R9A8yq4
Github: https://github.com/T0shik
Twitter: https://twitter.com/anton_t0shik
Instagram: https://www.instagram.com/anton_t0shik/

Support:
Patreon: https://www.patreon.com/raw_coding
Donate: https://streamelements.com/raw_coding/tip

Affiliate Links
Shared Hosting or ASP.NET Core: http://www.SmarterASP.NET/index?r=Toshik
Kojos Trick Lab (Tricking Tutorials) - https://www.kojostricklab.com/?wpam_id=93
c#asp.net coremiddleware

Do you know what time it is? DISCO TIME!

Do you know what time it is? DISCO TIME!

30+ HACKS TO BECAME AN ACTOR

30+ HACKS TO BECAME AN ACTOR

Paulo Mendonça "if you want my love " Straight2tape

Paulo Mendonça "if you want my love " Straight2tape

[MV] GAIN(가인) _ Apple (Feat. Jay Park(박재범))

[MV] GAIN(가인) _ Apple (Feat. Jay Park(박재범))

Corvette🚘 (Ft Lil Uzi Vert)

Corvette🚘 (Ft Lil Uzi Vert)

Yo Geet timro lagi ft Neps shrewd &Pradip Nepali(OFFICIAL)

Yo Geet timro lagi ft Neps shrewd &Pradip Nepali(OFFICIAL)

HITMAN - Paris - The Personal Touch & More Than You Bargained For - Professional Difficulty

HITMAN - Paris - The Personal Touch & More Than You Bargained For - Professional Difficulty

How To Make perfect Roasted Chicken Oven

How To Make perfect Roasted Chicken Oven

A guide to buying Youtube Play Buttons on Ebay

A guide to buying Youtube Play Buttons on Ebay

Fally Ipupa - Ecole (Clip officiel)

Fally Ipupa - Ecole (Clip officiel)

A VERY LARGE EXPANSE OF SEA by Tahereh Mafi | non-spoiler review + booktalk

A VERY LARGE EXPANSE OF SEA by Tahereh Mafi | non-spoiler review + booktalk

92 News HD LIVE | Latest Pakistan News 24/7

92 News HD LIVE | Latest Pakistan News 24/7

How to Build a Timber Retaining Wall | This Old House

How to Build a Timber Retaining Wall | This Old House

Thunderstorm & Rain Sounds | Nature Sounds Sleep Aid | Insomnia Relief 9 Hours

Thunderstorm & Rain Sounds | Nature Sounds Sleep Aid | Insomnia Relief 9 Hours

Formula of Area, Perimeter and Volume || Mensuration | 10 Math formula | क्षेत्रफल और आयतन का सूत्र

Formula of Area, Perimeter and Volume || Mensuration | 10 Math formula | क्षेत्रफल और आयतन का सूत्र

Homemade insecticide for plants | Epektibong pesticide para sa halaman | Make Homemade Insecticide

Homemade insecticide for plants | Epektibong pesticide para sa halaman | Make Homemade Insecticide

How to sign up for Roblox 2018

How to sign up for Roblox 2018

Shaping an Oblong Loaf

Shaping an Oblong Loaf

5 Things you NEED to think about BEFORE you lift your truck

5 Things you NEED to think about BEFORE you lift your truck

COMMENT OUT #26 / Алёна Водонаева х Настасья Самбурская

COMMENT OUT #26 / Алёна Водонаева х Настасья Самбурская

The Amazing World of Gumball | The Black Friday Sales | Cartoon Network

The Amazing World of Gumball | The Black Friday Sales | Cartoon Network

Josh Groban - Remember When It Rained (From Awake Live)

Josh Groban - Remember When It Rained (From Awake Live)

The Call of the Wild | Official Trailer

The Call of the Wild | Official Trailer

TAPPING LEGENDS SECRET PET GIVEAWAY WINNER ANNOUNCED!😱 | ROBLOX

TAPPING LEGENDS SECRET PET GIVEAWAY WINNER ANNOUNCED!😱 | ROBLOX

A BEGINNERS GUIDE - MEASUREMENTS FOR ALL AGES - TIPS FOR FALLING SHOULDERS

A BEGINNERS GUIDE - MEASUREMENTS FOR ALL AGES - TIPS FOR FALLING SHOULDERS

10 Best RC cars of 2020

10 Best RC cars of 2020

Checking Out OTHER GIRLS In Front Of My Girlfriend..

Checking Out OTHER GIRLS In Front Of My Girlfriend..

Best of 2019 Mix

Best of 2019 Mix

Barnier Says EU and U.K. Aren't in a Position to Reach Brexit Deal Yet

Barnier Says EU and U.K. Aren't in a Position to Reach Brexit Deal Yet

Increasing number of mental illness patients in China

Increasing number of mental illness patients in China

THIS WAS THE BEST GOLF LESSON IVE EVER HAD

THIS WAS THE BEST GOLF LESSON IVE EVER HAD

Uncomplicated | Fearless BND | Hillsong Young & Free Cover

Uncomplicated | Fearless BND | Hillsong Young & Free Cover

Oddly Satisfying Cake Decorating - The Best Chocolate Cake Recipes - So Yummy Cheesecake Recipe

Oddly Satisfying Cake Decorating - The Best Chocolate Cake Recipes - So Yummy Cheesecake Recipe

Home Quarantine Siddha medicines | Does it is advisable or not? DrMerish Siddha Post CoVID Clinician

Home Quarantine Siddha medicines | Does it is advisable or not? DrMerish Siddha Post CoVID Clinician

GARDEN DREAM BOARD (& more geeky cottage garden talk than you probably actually want)

GARDEN DREAM BOARD (& more geeky cottage garden talk than you probably actually want)

Chicken Tikka | Creamy Tikka | Malai Tikka | Cooking for Youngsters | Special Recipe

Chicken Tikka | Creamy Tikka | Malai Tikka | Cooking for Youngsters | Special Recipe

Axwell - Tomorrowland 2019 (Audio)

Axwell - Tomorrowland 2019 (Audio)

Vestige Assure Complete Fairness Cream - Review & Comparison | Why It`s the Best Fairness Cream..?

Vestige Assure Complete Fairness Cream - Review & Comparison | Why It`s the Best Fairness Cream..?

Tom Brady Returning for His Tenth Super Bowl | The Tonight Show

Tom Brady Returning for His Tenth Super Bowl | The Tonight Show

How to make a GREAT Tutorial

How to make a GREAT Tutorial

Minecraft Battle: NOOB vs PRO: HEROBRINE VS GOD CHALLENGE / Animation

Minecraft Battle: NOOB vs PRO: HEROBRINE VS GOD CHALLENGE / Animation

The Peak Surfing Raw

The Peak Surfing Raw

"Hallelujah - Aleluya" (Michael W. Smith) performed by Jotta A. on Brazilian TV

"Hallelujah - Aleluya" (Michael W. Smith) performed by Jotta A. on Brazilian TV

What we do When We’re NOT Making VFX Artists React

What we do When We’re NOT Making VFX Artists React

Little Mix - Touch (Official Video)

Little Mix - Touch (Official Video)

Mystery Box Slime Challenge / Making Slime Out Of Weird Objects

Mystery Box Slime Challenge / Making Slime Out Of Weird Objects

မင်းကိုချစ်လို့ - မေ ( Min Ko Chit Loh - May ) New Version

မင်းကိုချစ်လို့ - မေ ( Min Ko Chit Loh - May ) New Version

What is a Protein? (from PDB-101)

What is a Protein? (from PDB-101)

Kylie Jenner Wants How Many Kids?! | E! News

Kylie Jenner Wants How Many Kids?! | E! News