Multithreading vs Asynchronous Programming

2022 ж. 15 Қаң.
12 211 Рет қаралды

Multithreading and Asynchronous Programming are two concepts, that people usually get confused with. This video explains the difference between multithreading and asynchronous programming using some real world examples.
Reference articles,
docs.microsoft.com/en-us/show...
www.ibm.com/docs/en/cobol-zos...
*******************************
💥 Thanks for visiting 💡 Nutshell. 💥
The channel focus on introducing software concepts, that cover area like Languages and Frameworks, Infrastructure, DevOps, OOPS and many more. Technical breadth is essential for full stack development and it is important criteria in most full stack dev interviews.
This channel helps you to become the jack of all concepts. 😑
It is difficult to understand the details of all technical concepts in shorter period of time. And it also tiresome to watch hourly long videos to understand the concepts. The objective of this channel is to introduce the technical concepts and explain the crux of those concepts within 5 to 10 minutes. It is up to you to go ahead and understand those concepts in details, if it interest you. The idea is to keep the video as simple and short as possible to just introduce the concepts and make the viewers understand the purpose and use cases for such concepts.
Feedbacks and comments are highly appreciated. 😀
Website: www.jawahar.tech
Linkedin: / jawahars16
Twitter: / jawahars_16
Instagram: / jawahar16

Пікірлер
  • Very well explained, thank you! I have a question, Does using await when calling the asynchronous function discard the advantage of asynchronous flow? What is the best way to call an asynchronous function?

    @krithikabalu2235@krithikabalu22352 жыл бұрын
    • Thanks Krithika for watching Nutshell. 😊 Now to answer your question, asynchronous function behaves same no matter whether it’s been called using await or not. The purpose of asynchronous function is to return a promise which resolves in future. The await keyword is just a syntactic sugar. If the asynchronous function called with await, it only returns value after promise resolved (might take some time depends upon the function. So by this time execution goes to other parts of program). If the async function not called with await, you will immediately receive a promise object. You can attach a callback to it and get it executed once the promise resolved. Await is a convenient way to invoke asynchronous function especially to avoid callback hell.

      @jawahar.nutshell@jawahar.nutshell2 жыл бұрын
    • Thank you for the explanation..I had this doubt in my mind for a long time, now it's very clear :)

      @krithikabalu2235@krithikabalu22352 жыл бұрын
  • Very well explained Thanks.

    @akshaygupta2167@akshaygupta21672 күн бұрын
  • It was helpful, thanks

    @KungFuMonk69@KungFuMonk6919 күн бұрын
  • The explanation is very clear.

    @caniceonuoha@caniceonuoha7 ай бұрын
  • Behtareen 👏👏 explanation

    @z-sckool@z-sckool5 ай бұрын
  • Thank you for the detailed explanation

    @ShanthanReddyK-hl2zy@ShanthanReddyK-hl2zy2 ай бұрын
  • Excellent Explanation. Thanks 👍

    @prabhatkumar900@prabhatkumar9007 ай бұрын
  • Great explanation of the concepts in a simple way.

    @bitsnbytes4406@bitsnbytes4406 Жыл бұрын
    • Thanks for watching Nutshell. 💡

      @jawahar.nutshell@jawahar.nutshell Жыл бұрын
  • You are underrated bro . I really admire the effort you put into your work. The quality of your content is truly exceptional. Keep it up.

    @ajayvavdiya4902@ajayvavdiya49023 ай бұрын
  • Great explanation.

    @mohammadzaremoghadam8348@mohammadzaremoghadam8348 Жыл бұрын
  • Very good explanation and Examples....go head with other videos' , thank you!

    @user-xz6rw8cw7d@user-xz6rw8cw7d Жыл бұрын
    • Thanks for watching Nutshell 💡

      @jawahar.nutshell@jawahar.nutshell Жыл бұрын
  • Great explanation with great example.

    @kishanmistry3955@kishanmistry39559 ай бұрын
    • Thanks for watching. 💡

      @jawahar.nutshell@jawahar.nutshell9 ай бұрын
  • perfect explanation

    @dharmilshah8331@dharmilshah833111 ай бұрын
  • Excellent

    @shafiq.hussain.cscore@shafiq.hussain.cscore9 ай бұрын
  • Good explanation, and one for the bird.

    @jaycorrales5329@jaycorrales5329 Жыл бұрын
  • Great concept video Jawahar 👏👏👏

    @shashi1511@shashi15112 жыл бұрын
    • Thanks Shashi for watching Nutshell. 😊

      @jawahar.nutshell@jawahar.nutshell2 жыл бұрын
  • Thank you sir

    @pnworks9186@pnworks9186 Жыл бұрын
  • thank you i have multi thread program which connects multiple IP cameras in a Network but it is hanging when Network down or some time so how to change to asychronous please help

    @bushanrao1@bushanrao12 жыл бұрын
  • Well explained in a nutshell👏👍

    @sabarish.vzabrz5688@sabarish.vzabrz56882 жыл бұрын
    • Thanks Sabarish for watching Nutshell. 🙂

      @jawahar.nutshell@jawahar.nutshell2 жыл бұрын
  • superrrr sir

    @user-bb3kl5gr7l@user-bb3kl5gr7l10 ай бұрын
  • too good explanation

    @irfanhannure8623@irfanhannure8623 Жыл бұрын
  • Thanks that's helpful. But I still don't understand, say, in the boiler exmaple, if you only have one burner, you can't boil egg if you already boild milk, right? That happens with some single execution programs I am studying. How asychronous programming can be achieved in this case?

    @Pegasusjumpingoff@Pegasusjumpingoff3 ай бұрын
  • Nice explanations, thank you. Is multi-threading can be consider as one of the way to do parallel programming ?

    @MrKumaranraj@MrKumaranraj Жыл бұрын
    • Hi Kumaran Thanks for watching Nutshell. 😊 Multithreading and parallelism differs based on CPU cores available. One CPU can do only one task at a time even if you do Multi threading. (seriously, believe me 😜). So when you do multithreading on a single CPU, it just gives an illusion of parallel execution by switching between multiple tasks quickly (very quickly beyond our imagination 😱) But parallel programming can be real (not just illusion 🙂) by utilising multi core processors. With multiple CPU cores, you can literally execute multiple tasks at the same time. Hope it answers your question.

      @jawahar.nutshell@jawahar.nutshell Жыл бұрын
    • @@jawahar.nutshell Thanks again, please make a separate video explaining parallelism 🙂

      @MrKumaranraj@MrKumaranraj Жыл бұрын
  • Best video on this topic

    @mohsintamboli5202@mohsintamboli5202 Жыл бұрын
    • Thanks for watching Nutshell 💡

      @jawahar.nutshell@jawahar.nutshell Жыл бұрын
  • Understood multi thread concept

    @maulasab3388@maulasab33883 ай бұрын
  • Very good explanation! Clear, concrete!!! Thanks !

    @jtv1972@jtv1972 Жыл бұрын
    • Thanks for watching nutshell 💡

      @jawahar.nutshell@jawahar.nutshell Жыл бұрын
  • best video ever thx

    @kartiksaini5619@kartiksaini56198 ай бұрын
    • Glad you liked it!

      @jawahar.nutshell@jawahar.nutshell8 ай бұрын
  • So in asynchronous programing all the 3 request handled by single thread?

    @lokeshmnaik2875@lokeshmnaik2875Ай бұрын
  • Useful video 👍

    @shobhamahadev118@shobhamahadev1184 ай бұрын
    • Thanks for watching Nutshell 💡

      @jawahar.nutshell@jawahar.nutshell4 ай бұрын
  • Really a greate explanation with exact analogy but , still I have a question what is exact difference between asynchronous vs concurrency.

    @saravanasai2391@saravanasai23918 ай бұрын
    • asynchronous is a form of concurrency. By doing context switching btw the tasks we can achieve the concurrency.

      @shobhamahadev118@shobhamahadev1182 ай бұрын
  • Nice explanation

    @rabeehebrahim@rabeehebrahim Жыл бұрын
    • Thanks Rabeeh for watching Nutshell. 💡

      @jawahar.nutshell@jawahar.nutshell Жыл бұрын
  • Should mention that the usage of thread pools is to eliminate the cost of thread creation for each request as it comes in; the threads in the pool are already created and awaiting usage

    @drakezen@drakezen2 жыл бұрын
    • Yes exactly. The time taken and the compute power to create threads can be reduced by using thread pool with pre created threads. Thanks for watching Nutshell. 😊

      @jawahar.nutshell@jawahar.nutshell2 жыл бұрын
    • @@jawahar.nutshell Looking forward to more videos! thanks

      @drakezen@drakezen2 жыл бұрын
  • If one await methids Depends another await method result? Then how

    @maulasab3388@maulasab33883 ай бұрын
  • Nice explanantion

    @okumujustine@okumujustine10 ай бұрын
    • Thanks for watching nutshell 💡

      @jawahar.nutshell@jawahar.nutshell10 ай бұрын
  • Awesome

    @harithaes7573@harithaes7573 Жыл бұрын
    • Thanks for watching nutshell. 💡

      @jawahar.nutshell@jawahar.nutshell Жыл бұрын
  • How many threads created in asynchronous?

    @maulasab3388@maulasab33883 ай бұрын
    • there is no threads will be created for asynchronous but wherever you write await task delay or some actions that is when in order to resume from that place statemachine will internally creates one new worker thread which is called as callback thread for the main thread. This callback thread will be created internally by TPL it doesn't cost any resource ulitilization as we are not creating new thread externally using Thread t1= new Thread (Method); Summary: Async does not use any threads.

      @shobhamahadev118@shobhamahadev1182 ай бұрын
    • @@shobhamahadev118well explained

      @maulasab3388@maulasab33882 ай бұрын
KZhead