misunderstanding is extremely common. Many people are taught that multithreading and asynchrony are the same thing, but they are not. Example. You are cooking in a restaurant. An order comes in for eggs and toast. Synchronous: you cook the eggs, then you cook the toast. Asynchronous, single threaded: you start the eggs cooking and set a timer. You start the toast cooking, and set a timer. While they are both cooking, you clean the kitchen. When the timers go off you take the eggs off the heat and the toast out of the toaster and serve them. Asynchronous, multithreaded: you hire two more cooks, one to cook eggs and one to cook toast. Now you have the problem of coordinating the cooks so that they do not conflict with each other in the kitchen when sharing resources. And you have to pay them. Now does it make sense that multithreading is only one kind of asynchrony? Threading is about workers; asynchrony is about tasks. In multithreaded workflows you assign tasks to workers. In asynchronous single-threaded workflows you have a graph of tasks where some tasks depend on the results of others; as each task completes it invokes the code that schedules the next task that can run, given the results of the just-completed task. But you (hopefully) only need one worker to perform all the tasks, not one worker per task.
@RawCoding4 жыл бұрын
Can you explain to me what made you think I'm misunderstanding something? To me it seems you explained what I explained but from a high level, which is what everyone does, and at no time did I make the following claim: > that multithreading and asynchrony are the same thing, but they are not. My explanation is based around - handing off a task to something else to work on, so in your example it would be a fryer (external process) frying an egg (working on a task), and we are not waiting for it (thread isn't blocked). When I go to explain that a different thread may complete the rest of our task it's like chef1 starting to cook an egg and chef 2 finishes it. If you are just giving another high level overview of asynchrony there are ton's of these, people are still looking for these videos because they want to understand the abstraction behind it. And I'll re-state I do think your explanation is correct and informative but doesn't cut where it needs to.
@exogendesign45824 жыл бұрын
Should've have find this comment sooner, I should learn both though. What I want was Synchronous for my project Since it depends on the completion of the first task before the next. that's why I there is no blocking in my app, since im using async, it really baffles me but this comment really made me see the difference, and the video made me understand how to right the code, good combination. Thanks for sharing your knowledge Datta Bansode. and Raw Coding you guys rock.
@emreaka39652 жыл бұрын
@@RawCoding You said, "another thread is indeed going to complete the boiling process." but the man says "there is no another thread. it runs single thread." If I am wrong, please correct.
@ТарланИсмаилов-т2к2 жыл бұрын
@@emreaka3965 I think that the number of threads depends on operation type we need to execute (IO-bound or CPU-bound). IO-bound operations don't need additional threads, they use some external devices that don't need our help. But I might be wrong
@ZombieMagnum2 жыл бұрын
As I understand it from this video, the use of async/await DOES in fact sometimes automatically create additional threads, hoewever not necessarily for every async function or await statement. It is confusing that people insist that async/await is ''single-threaded asynchrony" when in practice it is not true. I do understand that multi-threading is a different concept, your explanation is great.
@ragtop6311 ай бұрын
Although I already had a pretty good understanding of how all this works, I have to say that your explanation is by far the best that I’ve seen. Too many times other videos show you some simple implementation that really can’t be ported to the real complexities of asynchronous programming. So you leave those videos with a “Hmm, ok. I guess that makes sense. But how do I apply it to my specific situation?” kind of feeling. What you’ve done here is not given us the fish but instead taught us how to fish. A fundamental understanding of complex topics is always the best method. Great job!
@pratikzirpe3153 жыл бұрын
I haven’t seen anyone else explain such complex concept with such ease and still thorough - to the point. Thank you 🙏🏻
@RawCoding3 жыл бұрын
Cheers!
@PaulSebastianM3 жыл бұрын
@@RawCoding 5:53 Cheers! 😆
@TJahmusick4 жыл бұрын
This is exactly how I wanted this explained to me. Incredible! Thanks!
@RawCoding4 жыл бұрын
Thank you for watching))
@aronhegedus7 ай бұрын
this is really useful because you're showing us the inbetween code, rather than just telling us. I find that that's usually the most instructive, because I can then go and check that as well
@mikecu22492 жыл бұрын
This must be the Best Explanation about this Topic on our Planet! You didnt not only manage to create a crystal clear image, approch and explanation. You also picked the confused C# Devs up who still tried to figure out, what the clock is happening to my code? Thank you!
@RawCoding2 жыл бұрын
Glad I could help!
@aleksandermirowsky7988 Жыл бұрын
Rust's async/await functionality operates in a similar way, as it also expands into a state machine. It has been explained by Rust experts multiple times, but your explanation takes it to another level. The ability to visualize the intermediate generated code is just the icing on the cake. Great stuff, happy to see that you're still an actively posting on KZbin. Instantly subscribed and activated notifications.
@RawCoding Жыл бұрын
Thank you really appreciate it!
@hsnnoznn Жыл бұрын
Man, I usually take the information I need and close the video but you are absolute legend. I can not skip without a huge thanks. You explained it very well. Again, thanks a lot.
@ВладимирСоколовский-щ1ы Жыл бұрын
Dear friend. Visit youtube channel "Solve My Programming Task". They create simple programs for free. I used it. I am a student.
@speakoutloud72934 жыл бұрын
Man, I just can't get enough of your videos. You rock with this! Keep it up.
@RawCoding4 жыл бұрын
Cheers, glad you liked them
@spuriustadius50344 жыл бұрын
I got totally confused about Dump() and Dump(string s) until I realized that you are using some kind of built in extension method that your IDE (linqpad?) somehow defines for you. Once I understood that, it was super clear.
@RawCoding4 жыл бұрын
Awesome! glad it didn't get in the way too much :) Yeah linqpad is like a mini development environment, as you can see I get to run my code instantly instead of waiting for the app to compile/start etc... and the data vizualisation that you get through Dump can be pretty incredible :)
@nobytes23 жыл бұрын
pretty weird tbh, just use console write like every other human 🙄
@RawCoding3 жыл бұрын
No
@Jwhite19793 жыл бұрын
100% this! I'm 1:49 into the video, and I pull out C# In A Nutshell, find nothing, Google "String dump method", find nothing, search through KZbin comments for someone, for the love of god, anyone explaining what the hell this .Dump method is all about! Thank you Spurius. Today, you're the hero.
@RichardONeil3 жыл бұрын
@@RawCoding agreed...Linqpad is the greatest tool on my belt to quickly work things out. You get all the cruft out of the way and can hone directly in on an algorithm that you are trying to build, or understand. I highly recommend buying it to everybody that does this for a living.
@MiningMozo3 жыл бұрын
Step 1 - Complete High school Step 2 - Complete Colleges The next step is to figure out what the fuck is going on
@RawCoding3 жыл бұрын
Pretty much :P
@watherby2914 күн бұрын
Step 4 - Accept you will never know what's going on
@pieDesert2 жыл бұрын
S-Tier explanation and demonstration. It is so difficult to find decent tutorials out there, but this one was no fat just cut right to the information I needed to hear and delivered with such simplicity. Also actually using the full time of the video to teach and explain and not self promote and advertise. Appreciate the raw commentary!
@RawCoding2 жыл бұрын
Glad I could help)
@michalbrndiar53174 жыл бұрын
Crystal clear and absolutely the best explanation of this concept I've ever seen. Keep up great work! :)
@RawCoding4 жыл бұрын
Thank you )
@WantOxide4 жыл бұрын
Bullshit this crap is not clear
@michalbrndiar53174 жыл бұрын
Hmm, probably it is not this video's fault. 🤔
@WantOxide4 жыл бұрын
@@michalbrndiar5317 of course it is. there are more clear videos, so it's clearly his video fault
@WantOxide4 жыл бұрын
@@michalbrndiar5317 And if it's not his video's fault it means you just do spaghetti code as he does (and spaghetti explanations)
@StreetBladerBloke3 жыл бұрын
Very clear and especially deep dive which is always a missing part in programming videos, you have nailed it.. thanks and keep it up with these videos they are pure gold..maybe u can create a course and sell it..I am sure deep dives are missing in today's programming world where instructors are just bothered about creame only but not the cake. You and Jamie king are the only ones who are taking it to another level. Thanks for ur efforts
@RawCoding3 жыл бұрын
Cheers, there will be a course at one point
@cuzsleepisthecousinofdeath3 жыл бұрын
Finally a person who's just like Jamie King(pardon me for making a comparison): straight to the point, showing the internal guts of things Subscribed instantly
@RawCoding3 жыл бұрын
Cheers
@LarrySmith14373 жыл бұрын
Well done, sir. I struggled with how to present this topic to my dev department, your example helped a lot.
@RawCoding3 жыл бұрын
Cheers
@geerivana3 жыл бұрын
Your videos are way better than any other official online courses
@RawCoding3 жыл бұрын
Cheers
@investmentjourney79123 жыл бұрын
Best explanation till now, not just showing windows form for ui activeness like others. 👍
@RawCoding3 жыл бұрын
Cheers
@dunefedaykiin4 жыл бұрын
Awesome video, like always! Looking forward to the next video about the practical use of async/await!
@RawCoding4 жыл бұрын
Cheers ))
@ghazanfarabbas41874 жыл бұрын
Never seen such a insightful video before. Keep it up man...
@RawCoding4 жыл бұрын
Thanks
@AjitGoel3 жыл бұрын
This is a amazing video, first clear explanation of the async-await internals. Thank you Raw Coding.
@RawCoding3 жыл бұрын
Thank you for watching
@TheFeaz4 жыл бұрын
Hey man, this (and your other video showing HOW to use async / await) was REALLY good information. Another person said it, but I'll say it again, this was the best presentation of this material that I've ever seen. I'm a senior software engineer with my company, and I've been here almost 20 years. Most of my work is in hard-core business logic, and I haven't done a lot with system-level stuff, multi-threading, and all that. With the changing system model these days and an emphasis on micro-services, I'm re-visiting these concepts (that and I'm doing some of my own private consulting now, doing web development, Docker containers, etc. and certainly am seeing a lot of this async stuff, particularly in the bakc-channel OAuth stuff.) Anyway, the biggest challenge I have learning this stuff in a meaningful way is that content out here usually goes one of two places-- It either shows very simplistic "hello world" type examples, that make would make a great "Await / Async 101" course or a college lab project, but in practice they don't scale well to anything resembling what we would actually DO in an enterprise application. On the other hand, there are task-oriented "how-to's" that show you the how but not the WHY. I really appreciated your deep-dive into this and a look at how the MSIIL implements this. That really gave a whole new dimension to my understanding of how this stuff actually works under the covers, and gives me some much-needed insight into how I could leverage these features in our enterprise applications.
@RawCoding4 жыл бұрын
Thank you for your comment))
@lefrutit2282 жыл бұрын
tutorials such that are exaclty what youtube needs lol, I barely can find tutorials that I cant understand from the first watching, they're too simple, but this is excellent, thank you!!
@RawCoding2 жыл бұрын
Thank you 🙏
@kopilkaiser89912 жыл бұрын
Thank you so much for taking the time to explain it. I have understood some of the concepts and I will need to rewatch it to better grasp the concepts. But still I was completely lost with this asynchronous programming, and was able to find some of the way by watching your tutorial. Thank you for simplifying the complex concepts. It takes a great mind to decode the entanglement which the async await Task brings in when you jump into it after being comfortable with synchronous programming. I will keep on digging into this until it is drilled deep into my mind.
@ВладимирСоколовский-щ1ы Жыл бұрын
Dear friend. Visit youtube channel "Solve My Programming Task". They create simple programs for free. I used it. I am a student.
@jimsteinPeerless4 жыл бұрын
You do overemphasize the importance of threads like everyone trying to explain Async does. It is a nice very demo but (this is not covered by this video) if you in the first example replace the await Task.Delay(300) with a busy loop (the same as in the main function) there will not be another thread spawn and everything will execute on a single Thread. This is task concurrency on a single thread(?). Task.Delay is not CPU bound but the busy loop is CPU bound. So Task.Delay is good for simulating an IO bound Task and therefore you get continuation on another thread. The threads are operating on a layer below concurrency, so you do not need to have multiple threads to have Task concurrency(?). Kind regards
@RawCoding4 жыл бұрын
Thank you for sharing
@mrcalico70914 жыл бұрын
@@RawCoding Thankfully, You're the teacher here!
@matthewkeron14484 жыл бұрын
schooooled him
@ВадимН-о9х4 жыл бұрын
Can someone please explain me what Jimstein Peerless meant? As he said, i replaced "await Task.Delay(300)" with CPU bounded task (the loop shown in the video for example): await Task.Run(() => { var a = 0; for (int i = 0; i < 100_000_000; i++) { a += i; } Console.WriteLine("CPU-bound task in running on ThreadId = " + Thread.CurrentThread.ManagedThreadId); }); And i still see it being executed on another thread (Console.WriteLine shows thread id different from the main thread id). OR did he meant not using async/await and just start a raw CPU bound loop? But then it would be totally synchronous program and it is not the point of this video. But he still got so many likes on his comment. So seems like people found it useful. I am so confused...
@RawCoding4 жыл бұрын
I guess I haven’t explained the Task.Run in this video where it’s literally a task you give the thread pool to execute, if you have a Synchronous Task method that returns a task without having async await , it will literally wait for the function to finish executing to give you the result of a Task object, like a normal function you are just waiting for the return value.
@RawCoding Жыл бұрын
Want to know C# as I do it? Get My C# programming course learning.raw-coding.dev/csharp-programming-course
@_Ming_Ming_2 жыл бұрын
Thank you for this clear explaination sir! for this I will never skip ads in your video
@RawCoding2 жыл бұрын
thank you
@jasonherrera76054 жыл бұрын
Thank you, it is difficult for me to follow your English, but it has been the best explanation I have ever known.
@RawCoding4 жыл бұрын
Awesome, thank you )
@magerehenk75793 жыл бұрын
why is it difficult to follow his english?
@RawCoding3 жыл бұрын
I’m not a native speaker and some other people aren’t ether, so it’s a compounding effect
@phongs2nhu4 жыл бұрын
Good job, man. I'm from Viet Nam. So by watching your video, I studied new knowledge and English language. Of course, your voice is great with nice intensity. Thanks a million.
@RawCoding4 жыл бұрын
Glad I could help :)
@forbin804 жыл бұрын
Bruhhhh... I've been reading about and even using async for a couple years now and in 20 mins you just cleared up everything I didn't understand about the way this stuff works. All the weirdness I've seen in my code now makes perfect sense. Fantastic video, I can't thank you enough. By far the most clear explanation of async/await I've ever seen.
@RawCoding4 жыл бұрын
Thank you, glad I could help:)
@decentwig564827 күн бұрын
Async has never really clicked until today, thank you very much.
@hlazunov2 жыл бұрын
This is the insane video about async/await in .NET. I have never seen a better explanation of async in .NET. Thanks a lot.
@oganovdavid3 жыл бұрын
Thanks so much for sharing your knowledge. Haven't met anyone explaining this better than you. I've finally got some understanding of what's going on. Subscribed
@RawCoding3 жыл бұрын
Cheers, glad I could help :)
@anpham8714 жыл бұрын
Thanks a lot!! You motivated me so much!! You are the best C# developer i've ever seen on youtube.
@RawCoding4 жыл бұрын
Cheers ma dud ))
@zhh1744 жыл бұрын
thank you so much. no one explained it on youtube. they just show the use of async and await.
@RawCoding4 жыл бұрын
Cheers, that’s what my problem with all the tutorials were :)
@НазарийСавиных3 жыл бұрын
Best explanation i've ever seen. Thanks!
@RawCoding3 жыл бұрын
Ty
@rafiul41 Жыл бұрын
One of the most underrated channels on KZbin.
@razortier4284 Жыл бұрын
Great job. Not so many guys are explaining how it works under the hood with state machine
@marketfinds2 жыл бұрын
Excellent work, glad you went down into the IL Code. Helps make it clearer what magic is going on.
@RawCoding2 жыл бұрын
Glad you liked it!
@elkhoukhi4 жыл бұрын
Man I just came across your channel, quality material! I subscribed, Keep up the good work
@RawCoding4 жыл бұрын
Thank you, hope you like the rest :)
@Time_Leak4 жыл бұрын
Thanks for the clear explanation. It was really helpful to see IL that is responsible for all the magic.
@RawCoding4 жыл бұрын
Cheers)
@Esurnir3 жыл бұрын
Thank you for clearing up this absolute swamp of complexity that is async await in c#
@RawCoding3 жыл бұрын
Thank you for watching))
@martinrogachevsky56272 жыл бұрын
One of the best explanations so far, great examples, thanks a lot! Only one thing didn't let me go through this on the first attempt is when you were explaining what network device is doing with the thread on your 'art', you said that it "frees" the thread. For someone who is not native speaker that sounded a lot like "freeze" the thread and really confused me for some time. So just be aware of these little verbal things but in general very helpful and worth sharing!
@RawCoding2 жыл бұрын
Thank you, yeah I’m not a native speaker so might mess up some pronouncements
@No.School.dk_Colur2 ай бұрын
I thought I had an understanding of async/await but I didnt have nearly as much understanding as I have now tysm!
@MichaelVBrown-h2n Жыл бұрын
Awesome video! Just what I was looking for. Also while I was diving into the Task code I had noticed a TaskStatus enum at the top. Immediately I was thinking that there must be some state machine at work happening here. So thanks for confirming that.
@gotham4u2 жыл бұрын
Wow, I understood it finally . I was trying to understand async and await keywords for last an hour, but "yield" was not comprehensible. Thanks very much.
@RawCoding2 жыл бұрын
Cheers, I have a video about IEnumerable and yield you can have a look
@armandopenaleonett12583 жыл бұрын
Thank you I have always had problems understanding this now it's way more clear!
@RawCoding3 жыл бұрын
Awesome 👏
@owiz92124 жыл бұрын
Thanks very much Anton! Really simplifies asynchronous processing. Much appreciated!!
@RawCoding4 жыл бұрын
Thank you for watching
@emrealtuntas13192 жыл бұрын
After 05:51 i directly clicked like button.
@RawCoding2 жыл бұрын
Hehe
@MetaArcher4 жыл бұрын
Pretty cool and clear video. One of the best async videos I've seen. Hope next time you do a deep dive to compare Parallelism and Async
@RawCoding4 жыл бұрын
Thanks, as I’ve shown in this video it’s pretty much parallel already )
@sankaralingammuthusamy6142 Жыл бұрын
It was really superb explanation about async and await. Thanks bro keep up the good work
@vaya992 жыл бұрын
Best explanation for async await 👍, looking for deep dive for .ConfigureAwait() function. Keep it up ... how my computer is expecting it and how to read a code sequence is best part with respect to state sequence explanation.
@RawCoding2 жыл бұрын
Glad I could help )
@BorisMiljkovic2 жыл бұрын
Finally, a good explanation. Thank you!
@RawCoding2 жыл бұрын
Glad you enjoyed it!
@strange_guid6 ай бұрын
Awesome explanation! Please keep up the good work
@ehsanhadid12603 жыл бұрын
Just wow, I want to go back, leave University and just follow you.
@RawCoding3 жыл бұрын
Haha don’t do that :P
@koenfrontatie10 ай бұрын
really appreciate your style of teaching! you've helped me lots
@stevenstone3072 жыл бұрын
Awesome explanation mate. Funnily enough another thing I learnt in this video is that you can put underscores in big numbers lol
@RawCoding2 жыл бұрын
Double whammy!
@pintileiciprian4 жыл бұрын
This is great work, man, keep it up!
@RawCoding4 жыл бұрын
Cheers ))
@mrwillis53394 жыл бұрын
Useful to hear a concise explanation .
@RawCoding4 жыл бұрын
Glad I could help
@thatguywiththeface94632 жыл бұрын
Very detailed and well explained tutorial. Thank you, coding Jesus!
@RawCoding2 жыл бұрын
Haha thank you
@KrishnaList4 жыл бұрын
Very Nice Explanation Anton It is really Deep Dive
@RawCoding4 жыл бұрын
Thanks )
@ldohlj14 жыл бұрын
Wow! Great analogy and great explanation. Thank you
@RawCoding4 жыл бұрын
Thank you for watching
@alexplom59583 жыл бұрын
Absolutely phenomenal video
@RawCoding3 жыл бұрын
Cheers)
@AC-fs2rl Жыл бұрын
This is the thing I was looking for, thank you
@RawCoding Жыл бұрын
Glad I could help!
@Hypermommy3 жыл бұрын
Thank you for this very clear explanation of a sometimes confusing concept.
@RawCoding3 жыл бұрын
Thank you for watching
@emmanuelmotsi2 жыл бұрын
Such a great explanation. Learn a lot from the DEEP DIVE! Thanks!
@mkowalski27084 жыл бұрын
Just top notch content lately, much appreciated 😁
@RawCoding4 жыл бұрын
Thank you ))
@BryantCobarrubias2 жыл бұрын
You're a very good teacher.
@RawCoding2 жыл бұрын
Thank you
@iedi311 ай бұрын
very impressive quality, and the relaxed atmosphere just perfect for some cigarettes and a beer (even though i stopped both), plus a reggae music in the background
@kasra78854 жыл бұрын
You left no questions. And a good rhythm
@RawCoding4 жыл бұрын
That’s what we like :D
@BradenJohnYoung Жыл бұрын
Finally, a good freaking explanation. Thank you!
@martinnicolas13994 жыл бұрын
Finally, I understand what is happening! Thanks
@RawCoding4 жыл бұрын
That is awesome
@tylergoffinet10854 жыл бұрын
Great personifications and IL code walkthroughs! Thanks!
@RawCoding4 жыл бұрын
Cheers
@abhirammadhu2973 Жыл бұрын
You didn't add sugar😒 BTW, this is the best video explaining async/await in C#. You're right. All other video just simply explains how to implement asynchronous program rather than explaining what exactly happens under the hood.
@RawCoding Жыл бұрын
thank you
@DynamicalisBlueАй бұрын
Thanks this is great. I couldn’t sleep without knowing. I’ve always just used it but when I heard about JS Event Loop I was like “C# definitely doesn’t have an event loop right?” but I needed do confirmation. One thing I’m still a bit confused about is that since the tasks can be completed from any thread, how is it I’m able to safely use other objects without running into concurrency issues? For example, if I had two separate Async functions that waited on some network request but upon completion, they both write to a shared data container. I’ve somehow never encountered an issue with this but I’m confused how as if two threads try to write to the same data, it should lead to issues.
@rowanlidbury4 жыл бұрын
How have I not found you before.? You need to investigate why you don't show up cos this is gold.
@RawCoding4 жыл бұрын
Thank you)
@onnuttig3 жыл бұрын
Finally just a simple example of how this shit works, thanks man, instant sub
@RawCoding3 жыл бұрын
Glad you like it )
@Skillamu Жыл бұрын
Very good explanation and demonstration. Great video!!
@loam3 жыл бұрын
23:36 Second second, heh, nice language metamorphosis, I noticed that thing myself couple weeks ago while ruminating in English, and now It pop ups in the video)
@RawCoding3 жыл бұрын
hehe )
@muxa0003 жыл бұрын
Wow, this is an awesome explanation!
@RawCoding3 жыл бұрын
Cheers
@tomaszwitkowski95453 жыл бұрын
I am in the fifth minute and I got understood it more than I had understood after the classes
@RawCoding3 жыл бұрын
Hope you find the rest just as useful)
@amitagrawal46603 жыл бұрын
Very nicely explained 👏
@RawCoding3 жыл бұрын
Thank you
@FroboDaggins Жыл бұрын
Hi, what is this .Dump() command? Is this something you wrote yourself or a NuGet package or the program itself? It doesn't seem to be a thing using C# on Visual Studio
@RawCoding Жыл бұрын
it's a method provided by LinqPad, it's a fancy Console Writeline
@תהילהאהרונוביץАй бұрын
you just earned my subscription, great respect for you! 🙏
@sushil12004 жыл бұрын
Very nice explanation!
@RawCoding4 жыл бұрын
Thank you
@arunkutube3 жыл бұрын
love it, thanks for explaining using ILSpy, it makes things clear.
@RawCoding3 жыл бұрын
Glad you like it
@sreekanthbharatham75774 жыл бұрын
Simple and very useful explanation of context switching. Never seen anyone put it together like this. For a long time I was aware the await takes control back to caller making it do other stuff. But never could grasp how potentially another thread picks up the context to continue from where it left off. That realization and looking at different thread ids in different blocks made a world of difference in my understanding. Simply outstanding !! Thank you
@RawCoding4 жыл бұрын
Glad I could help:)
@abdurrahmankhan86802 жыл бұрын
Great Job. What a brilliant deep dive.
@StevenBloomfield4 жыл бұрын
Always wondered what all the MoveNext calls were in aggregate exception stack traces. I see now where they come from. Thanks!
@RawCoding4 жыл бұрын
Glad I could help
@tarlanismailov52282 жыл бұрын
It's clear when you talk about IO-bound operations because that operation can be completed out of the current CPU and there's no point to wait until it's done and additional threads aren't needed. But what about CPU-bound operations? If asynchronous programming implies 1 execution thread, then how CPU-bound operation can be executed without blocking this 1 thread that we have?
@RawCoding2 жыл бұрын
Async implies the work will be completed somewhere else, concurrently or parallel you don’t know. Handing off a task to a network card in io bound, is the same as handing off a task to a cpu processor in cpu bound.
@tarlanismailov52282 жыл бұрын
@@RawCoding so based on the above, for example, Task.Delay() operation which is IO-bound will be executed out of our isolated execution environment (I made conclusion that it is isolated) and no additional threads will be added, right?
@RawCoding2 жыл бұрын
You won’t know if a thread was added or no
@tarlanismailov52282 жыл бұрын
@@RawCoding I mean within our application
@RawCoding2 жыл бұрын
@@tarlanismailov5228 it highly depends and varies from situation to situation. But you won't know.
@ClassicRollPlayer2 жыл бұрын
i dont understand what the for loop at 9:44 is demonstrating ... can anyone explain? If make that too long the thread never changes... if I remove it altogether, the threads do change on #5. Thanks!
@RawCoding2 жыл бұрын
It’s simulating a busy cpu, if you make it too long it might take a while to get through.
@ClassicRollPlayer2 жыл бұрын
@@RawCoding thank you!
@johndoe31814 жыл бұрын
Thanks a lot!! You deserve more viewers!
@RawCoding4 жыл бұрын
Thank you
@ДанекКиллер8 ай бұрын
Bro really good explanation, thank you!
@abuzeromohammed33864 жыл бұрын
You hit important topics thanks
@RawCoding4 жыл бұрын
Thank you )
@gianmarcote4 жыл бұрын
Subscribed just by watching this video!
@RawCoding4 жыл бұрын
awesome :) glad you like it
@gianmarcote4 жыл бұрын
@@RawCoding Just to clarify, the most obvious gain from this is that we are freeing up the thread while the operation is ongoing, right? And then when the operation completes the state machine will kick in and transfer control to the code after the await?
@RawCoding4 жыл бұрын
Yes
@davidhainovitz28382 жыл бұрын
Hi great explanation: Just would like a clarification: I'm referring to around 10:00 when you reduce the looping time. When its long the original thread still exists so the rest of the program uses it till the end even though the task uses a different thread as compared to when the loop is shorter so its released before the task completes and a different thread completes the program. Is this a correct understanding? Thanx
@stivio004 жыл бұрын
Awesome! really nice explained.
@RawCoding4 жыл бұрын
Thank you)
@qwerty56894 жыл бұрын
Thanks for your vids mate. Really helpful! Keep it up :)