What are ASYNC and AWAIT in C#? Asynchronous Programming Tutorial

  Рет қаралды 77,708

tutorialsEU

tutorialsEU

Күн бұрын

Пікірлер: 66
@tutorialsEU
@tutorialsEU 2 жыл бұрын
🚀Master C# and .NET programming EASILY with our best-selling C# Masterclass: bit.ly/47Hk3u7
@Rodioser
@Rodioser Жыл бұрын
I struggled, and I'd say that I'm still struggling with understanding of how async works. But surely I'm making progress in understanding it and this video was a big help. For me it's the best explanation of async that I've seen.
@kopilkaiser8991
@kopilkaiser8991 Жыл бұрын
The other videos on youtube explaining asynchronous programming is much more difficult to understand. But you have been able to explain this in a more simple and easy way. Thank you for making such great effort. I hope you have a great day and achieve much more success in your life being able to gain more knowledge across all areas.
@aricwilliamsdeveloper
@aricwilliamsdeveloper 2 жыл бұрын
this guy is an incredible teacher
@frosky9497
@frosky9497 8 ай бұрын
For people that still dont get it , how it works codewise basically whenever a current debug line (this is simplified) meets await keyword action is forwarded to the code straight after that function usage which had await keyword inside it, if there is no function before that code simply waits. when action finishes another "executor" comes back and continues execution from the place await was setlled in. Keep in mind program can finish before that action completes so its always important to wait for the task (unless its fire and forget like write to a file in a UI app!)
@AllAboutDataTechnology
@AllAboutDataTechnology 11 ай бұрын
this is the best tutorial on async and await that I have seen. Clear and consise examples given.
@stefanlabuschagne6905
@stefanlabuschagne6905 4 ай бұрын
In Short If you execute code synchronously and hit an async task, the task goes off on its own thread and does what it should. The synchronous code continues in parallel. To wait for the task to complete and use the return value, use the await keyword. But then you should change the original / containing method to be an async Task as well. And so it ripples to sub Main.
@GurtMan100
@GurtMan100 3 жыл бұрын
Super useful tutorial! Been trying to get a grip on async for a while now, and this really helped.
@Felipe-mg1pw
@Felipe-mg1pw 2 жыл бұрын
You should definitely not be using Thread.Sleep() inside an asynchronous method. Use Task.Delay() instead.
@BBTRaziel
@BBTRaziel Жыл бұрын
and don't forget to await it 😉
@stephenwood4814
@stephenwood4814 7 ай бұрын
This is an excellent video. One nit: you use the word "parallel" early in the video, then again about 14 minutes in. The correct term here would be "concurrent", I believe, since it's important to distinguish between concurrent (single worker thread, async/await) and parallel (multiple worker threads, Threadpool e.g.).
@maiksonstrife
@maiksonstrife 2 жыл бұрын
This kinda of tutorial should be default, it's the best one. A lot of other tutorials abstract the lesson in 50 hundred layers of abstraction, the person that is trying to teach seems to be conflicted: should I just teach this in the best way possible or should I show off my awesome coding skills?
@quicktastic
@quicktastic 2 жыл бұрын
The key to this being good is in using a simple example. Nice job.
@getsmartpaul
@getsmartpaul 2 жыл бұрын
Thank you for this excellent coding example. It’s educational how you show the most basic first and progress to a more useful example!
@getsmartpaul
@getsmartpaul 2 жыл бұрын
I want to apply this to a asp.net Mvc file upload and a long processing of the file data example. I assume making the processing asynchronous will minimize blocking the main MVC thread ?
@Jackson_Nguyen
@Jackson_Nguyen 2 ай бұрын
Your video help me understand more about asynchronous. I hope you will have more useful videos like this in the future
@kopilkaiser8991
@kopilkaiser8991 Жыл бұрын
This video was a great help and a step up in reaching to grasp the concept of this complicated and difficult topic in C#
@NHGeneral
@NHGeneral 11 ай бұрын
I have a program like this: 1. Have a static string[] 'values'. 2. Task 1 is event driven, update the content of the string[] 'values' whenever condition meets. 3. Task 2 is periodically use the data from 'values' array to display status of the equipment. Please help me how to implement this into the project.
@aguelejoseph5753
@aguelejoseph5753 2 ай бұрын
very straight forward and clearly explained. Thank you
@raven.4815
@raven.4815 Жыл бұрын
Goddamn, someone that finally explains it in a non flustered way. Thank you so so much!
@siddarthapal2792
@siddarthapal2792 10 ай бұрын
Simple examples to explain with graphics helps. Great work buddy :), god bless
@efrenfeliciano5150
@efrenfeliciano5150 6 ай бұрын
Best ever explanation I have watch.
@ahadporkar7355
@ahadporkar7355 3 жыл бұрын
Very Simplified and nice explanation
@MikeFlyItAll
@MikeFlyItAll Жыл бұрын
You're a good teacher... thank you and cheers
@sunilGMI
@sunilGMI Жыл бұрын
Thanks for making a wonderful Video on Async and Await
@BeansEnjoyer911
@BeansEnjoyer911 2 жыл бұрын
now lets get started with the course now lets get started with the content and now lets get started with.. the tutorial nice poem!
@NeonGreenT
@NeonGreenT 2 жыл бұрын
I thought he was trying to hint at curly brackets, like: namespace bla { static bla main() { static void methodbla() { nowWeTalking(); } } }
@day35ofdebuggingthesamelin56
@day35ofdebuggingthesamelin56 2 жыл бұрын
I think he was just making a few short intros and outros so that he can use them for many other videos, but forgot to edit that out lol
@NeonGreenT
@NeonGreenT 2 жыл бұрын
@@day35ofdebuggingthesamelin56 no that was def. on purpose
@mikicerise6250
@mikicerise6250 Жыл бұрын
Question: If your main thread crashes after having spawned async threads, what happens? Do the threads close? If not, what happens when they try to return their Task? Is there a way to do an elegant shutdown of all existing threads using a destructor in the parent thread?
@ssbunnies2015
@ssbunnies2015 Жыл бұрын
good one, simple and crisp
@mermaidoasis8452
@mermaidoasis8452 5 ай бұрын
Could asynchronous programming be used inside for loop with nested if statements or would it be useless? Thank you so much.
@alexpato4
@alexpato4 8 ай бұрын
The async keyword DON'T specify that a method is asynchronous, it just starts the state machine for the method. In another words, the async keyword just prepare the method to do some asynchronous stuff. You can have a method that returns a Task and are not marked with "async"
@os-channel
@os-channel 3 жыл бұрын
step by step, great!
@doointhedoo
@doointhedoo Жыл бұрын
I'm an American and this tutorial made me hungry and want breakfast. :)
@vagrantrandomstuff2312
@vagrantrandomstuff2312 Жыл бұрын
Very informative sir. Thank you
@couch_coach
@couch_coach 2 жыл бұрын
perfect explanation, thank you
@sathishraj1
@sathishraj1 2 жыл бұрын
Excellent tutorial
@Charles_001
@Charles_001 Жыл бұрын
thanks for your vieo it's best one
@TutorialMax9812
@TutorialMax9812 3 жыл бұрын
Hey Dennis, leider habe ich bei der Ausführung des Codes Compilerprobleme bezüglich der Main-Funktion. Ich verwende wie du "static async Task Main()", leider ist Visual Studio 2012 der Meinung, dass das keine geeignete statische Main-Methode ist. Ihm fehlt der Einstiegspunkt für das Programm. P.S.: Ich habe deine C# Masterclass durchgeführt und der Kurs war super! Schade, dass ASYNC kein Teil davon war. LG Max
@spartanAXA
@spartanAXA Жыл бұрын
Now let's get started with the tutorial
@ChrisWard74
@ChrisWard74 5 ай бұрын
Your first diagram shows "heating the pan," but your second one does not. You should have shown a comparison of doing it simultaneously as well.
@gabrielreinfalke2277
@gabrielreinfalke2277 Жыл бұрын
Example is good, but the theory as explained is wrong. For example, a void method is a void method and a Task method is a method that returns a Task. Returning sth. is indeed different than returning nothing or sth empty as null.
@Lonchanick
@Lonchanick 9 ай бұрын
Thread.Sleep does not block the thread?
@AlexxXRecorD
@AlexxXRecorD 3 жыл бұрын
Thanks, very interesting.!
@martorulez
@martorulez 2 жыл бұрын
brilliant
@mohamedslimen1041
@mohamedslimen1041 3 жыл бұрын
hi your work is very good am mobile apps dveloper and i have a game idea : is about a 2d mutiplayer game it can be just between 2 player i ilready developed it work perfectly localy but i want it to be in network like ludo king i need your help in a tutorial wich server is good for it ana does firebase realtime database is good for it or no i found many solution like foton and mlapi server please try to find a good solution for it it can be like ludo king help me please thanks
@sudipsaha-s3r
@sudipsaha-s3r 4 ай бұрын
You looks soo close to southafrican cricketer dale steyn
@znefas
@znefas Жыл бұрын
As many have pointed out, this is not a good tutorial which actually explains asynchronous programming, it's just a display of some pre-existing async functions, which to most developers worthy of being called such, is trivial and not very useful on its own.
@sihlejali8453
@sihlejali8453 2 жыл бұрын
What if you only have one pan? :)
@trustingod0
@trustingod0 11 ай бұрын
Unfortunately it’s not possible to make a video tutorial for a one size fits all. It’s a good tutorial if most of the audience can walk away saying they understood the concepts.
@johnmullally8711
@johnmullally8711 2 жыл бұрын
I get CS4014 in .Net 6.0 & VS 2022.
@ramonstanlyrodriguez4189
@ramonstanlyrodriguez4189 2 жыл бұрын
I coded the same thing and is not working for me why is that ?
@barnabas_666
@barnabas_666 2 жыл бұрын
maybe you misstyped URL adress, be carefull with letters like '1' and 'l'.
@74himgup
@74himgup 2 жыл бұрын
sorry but your example makes no sense to me. What is the advantage, what if you do not use async and await...you did not explain anything properly....
@andrebarendse177
@andrebarendse177 Жыл бұрын
INTPs and Programmers shouldn't make jokes... Just putting it out there.
@adolfomedina1774
@adolfomedina1774 2 жыл бұрын
i still dont understand, damn
@funarfiif982
@funarfiif982 2 жыл бұрын
Very poor video. He basically explains the syntax (which is trivial), but is not showing comparing executions of sync vs async or demonstrating the order of execution depending on method. Literally useless if you want to understand intricacies of async/await beyond basic use instructions.
@znefas
@znefas Жыл бұрын
totally agreed. there's no need for a video that just shows the async/await syntax, but doesn't show how to, for example, make your own asynchronous functions, and doesn't even show a thread that continues running, and the order of the function calls being less relevant.
@trustingod0
@trustingod0 11 ай бұрын
Is there a better video tutorial for understanding the intricacies of async/ await. Thank You ! You might try watching a Tim Corey video where he makes the comparison but that doesn’t make it a better video. The instructor for this current tutorial is extremely great instructor.
@nafiaus
@nafiaus 8 ай бұрын
thanks for the warning.
@sidali9272
@sidali9272 3 жыл бұрын
Not worth watching
@laythabdulkareem1887
@laythabdulkareem1887 2 жыл бұрын
Dude, you need to enhance your presentation skills 👎👎 You are so fast!
Settling the Biggest Await Async Debate in .NET
14:47
Nick Chapsas
Рет қаралды 147 М.
That's NOT How Async And Await Works in .NET!
12:25
Codewrinkles
Рет қаралды 26 М.
FOREVER BUNNY
00:14
Natan por Aí
Рет қаралды 28 МЛН
Real Man relocate to Remote Controlled Car 👨🏻➡️🚙🕹️ #builderc
00:24
C# Async Programming - Part 1: Conceptual Background
29:49
Rainer Stropek
Рет қаралды 66 М.
IEnumerable 🆚 IEnumerator Interfaces in C#
34:06
tutorialsEU
Рет қаралды 29 М.
AsyncIO, await, and async - Concurrency in Python
9:12
Socratica
Рет қаралды 110 М.
8 await async mistakes that you SHOULD avoid in .NET
21:13
Nick Chapsas
Рет қаралды 315 М.
"Stop Using Async Await in .NET to Save Threads" | Code Cop #018
14:05
C# LAMBDA Expressions and ANONYMOUS Functions Tutorial | 2021
14:30
.NET and C# are in trouble. Here is what I'd do.
10:57
Ed Andersen
Рет қаралды 104 М.