Synchronous vs Asynchronous Applications (Explained by Example)

Поділитися
Вставка
  • Опубліковано 6 лис 2024

КОМЕНТАРІ • 94

  • @yicai7
    @yicai7 3 роки тому +26

    Great explanation!! Thx a lot!!
    Synchronized: wait
    Asynchronized: do not wait

  • @hnasr
    @hnasr  6 років тому +55

    Thank you so much for the 10K 🤩Here are few jump codes
    Synchronous definition: 0:30
    Asynchronous definition: 1:25
    Synchronous Example: 2:25
    Asynchronous Example: 5:30

    • @MxAshtonian
      @MxAshtonian 4 роки тому

      you are the real MVP

    • @IreritemDavidOfere
      @IreritemDavidOfere 3 роки тому

      How can synchronous and asynchronous be achieved in the design of operating system?
      Very brief in words please.

  • @centerpide
    @centerpide 3 роки тому +16

    To sum up in 1 line - For synchronous you gotta wait for your request, for async, you don't need to wait for your request briliant!

  • @arhamsayyed9518
    @arhamsayyed9518 2 роки тому

    that's far most the easiest explanation i found about asynchronous programming

  • @rajnesingh123
    @rajnesingh123 3 роки тому +4

    Thanks for the video Hussein , good video as always , One feedback : i think one element that can be added to bring more clarify to Async call is to add 'what happens' when the async function gets completed ? How does it respond back to the callback and how the user is notified that job of uploading is actually done. i feel , adding this would bring more value to the video.

  • @meditationtracks3439
    @meditationtracks3439 5 років тому +3

    Thank you for creating this, it's a very simple and straight forward explanation with good example. Constructive feedback: Cut down the beginning and end to 20s rather than (1min +).

    • @hnasr
      @hnasr  5 років тому +3

      Thank you so much for watching Erik! Loved your feedback I gotta do better job at quickly jumping into the videos.

  • @MxAshtonian
    @MxAshtonian 4 роки тому +3

    Subscribed! I'm an online student getting my BS in IT right now. Thanks for this very helpful explanation!

    • @hnasr
      @hnasr  4 роки тому

      Ashton Powers amazing! Wish you all the best on your studies and feel free to ask questions here if anything is confusing.. cheers!

    • @IreritemDavidOfere
      @IreritemDavidOfere 3 роки тому

      @@hnasr
      Please help me out with this question.
      How can synchronous and asynchronous be achieved in the design of Operating System?

    • @IreritemDavidOfere
      @IreritemDavidOfere 3 роки тому

      @@hnasr
      Please help me out with this question.
      How can synchronous and asynchronous be achieved in the design of Operating System?

  • @mustaphaoukna9189
    @mustaphaoukna9189 4 роки тому

    Hi Hussein, I have a question please :
    Which of the following are part of an asynchronous call ? (4 correct answers)
    1 - Request submitted
    2 - Response submitted
    3 - Independent response
    4 - Event Notification
    5 - Publish/Subscribe
    Thank for ur answer

    • @hnasr
      @hnasr  4 роки тому

      Hi Mustafa, That is a confusing question but ill give it a shot
      Asynchronous call involves making a request (1) receiving a response (3) through an event or callback, (4)
      I don’t see server submitting a response (2) or public / subscribe (5) part of an asynchronous call. But if I would make a guess Ill pick 2 since you could receive an event when a response is submitted
      So my answer will be 1, 2, 3, 4

  • @MrDeeb00
    @MrDeeb00 Рік тому

    Hey, just wanted to let u know that the manual subtitles are too early.
    Thanks for awesome content :)

  • @shashishekhar----
    @shashishekhar---- 2 роки тому

    Wonderful and very helpful video as always Hussain, lots of love and respect brother 🙏👍

  • @sabrinamimouni8306
    @sabrinamimouni8306 5 років тому +5

    Gonna cry happy tears... 🥺😹
    Thanks a lot!!!

    • @hnasr
      @hnasr  5 років тому +1

      Sabrina MIMOUNI 😍

  • @lincolnkarim1
    @lincolnkarim1 4 роки тому +1

    I appreciate your time in trying to explain this topic which is often confused by even some of the more experienced engineers out there. My comment is meant for positive criticism only: Please take your time and enunciate your words better--there is no rush. Sometimes when you say 'ASYNCHRONOUS', it sounds like 'A Synchronous', where the 'A' sounds like the article before the adjective 'Synchronous'.

    • @hnasr
      @hnasr  4 роки тому +1

      Lincoln Karim thank you so much for your comment and you are absolutely right, Im trying to get better at speaking slowly and more articulate. Its a struggle. I think Im doing slightly better in my newer videos.
      Thanks again Lincoln. Let me know what other topics I can do next. Appreciate it
      Cheers
      Hussein

  • @khemanth1410
    @khemanth1410 3 роки тому

    I have a question here,
    In async call you are changing description and title and you are treating it has been successful, but let's assume that call got failed from the service provider , in this case what we showed earlier like successful it is not correct right and assume that I want to change description and title once file uploaded successfully then only I want to change it , in this case async will work out?

  • @medosh5511
    @medosh5511 16 днів тому

    this is explained so well. thnx

  • @cterogene
    @cterogene 2 роки тому

    Thank you, it's the explanation that i was looking for. I was stuck and wanted to find the concept explained for me. I prefer the asynchronous example. I didn't understand the asynchronous method by the way, You didn't added the V parameters when calling the upload success method.

  • @MrBomer213
    @MrBomer213 5 років тому +6

    i watch the entire "adds" as appreciating for the great video!(:

  • @mahathomorogo5625
    @mahathomorogo5625 2 роки тому

    How can we improve synchronous vertical federated learning algorithms?

  • @piyushyadav1964
    @piyushyadav1964 3 роки тому

    the way you explain is amazing

  • @arpitsharma3904
    @arpitsharma3904 5 років тому +1

    Hey I am confused that async call uses threading(i know it doesn't but) because for it to callback a success function it needs to work somewhere in the background and how does it show the percentage without creating a thread

    • @hnasr
      @hnasr  5 років тому

      Arpit sharma the async call doesn’t have to use another thread, take Javascript for example which is single threaded. It uses an event main loop where one thread is used for all events including awaiting on async result. Its not just busy waiting.. it is doing other things as well.
      Providing progress is a little different, because the server need to send constant updates to the client (10%, 60% etc. this can be achieved by implementing bidirectional connection like websockets or asynchronous service.. hope that helps :)

    • @hnasr
      @hnasr  5 років тому +1

      Arpit sharma ua-cam.com/video/LMaVIqfb3TQ/v-deo.html

    • @arpitsharma3904
      @arpitsharma3904 5 років тому

      @@hnasr So what I understood is that event loop checks every time it passes the i/o call that it is complete or not

    • @hnasr
      @hnasr  5 років тому +1

      Arpit sharma correct, the event loop checks multiple things and this is one of them. It also calls functions, make callbacks, and do IO as well.

    • @arpitsharma3904
      @arpitsharma3904 5 років тому

      @@hnasr Thanks was really stuck at this!

  • @thabisohitchdladla
    @thabisohitchdladla 3 роки тому

    Awesome work Hussein

  • @alexramirez5104
    @alexramirez5104 2 роки тому

    Thanks for this video!

  • @nitreall
    @nitreall 2 роки тому

    What happens if the upstream server is down?

  • @saansis
    @saansis Рік тому

    Is Amazon search synchronous or asynchronous?

  • @_SoundByte_
    @_SoundByte_ 4 роки тому

    Can you please talk on non blocking io vs blocking io ? And how will it affect the server performance based on the use case? io intensive vs cpu intensive...java vs nodejs

    • @hnasr
      @hnasr  4 роки тому

      swapnil kale not much different its very similar to sync vs async except at io level language decisions matter here
      This might help
      Asynchronous vs Multithreading and Multiprocessing Programming (The Main Difference)
      ua-cam.com/video/0vFgKr5bjWI/v-deo.html

  • @carlfrisen7705
    @carlfrisen7705 4 роки тому +1

    Thanks! Short and concise :)

  • @javascriptduniya1201
    @javascriptduniya1201 4 роки тому

    var counter =[1,2,3,4,5,6]:
    for(var i in counter) {
    setTimeout(function(i) {
    console.log(counter[i]) // 1,2,3,4,5,6
    },500);
    }
    is there any way i can print my counter numbers one by one with delay of 500ms ?

    • @hnasr
      @hnasr  4 роки тому

      Javascript Duniya
      function printC(array, currentIndex){
      If (currentIndex > 6) return
      Console.log(array[currentIndex])
      SetTimeout( () => printC( array, currentIndex+1) , 500);
      }
      printC( [1,2,3,4,5,6], 0);

  • @inadaizz
    @inadaizz 5 років тому +1

    'searched a lot'
    No you're my first stop. =]
    Thank you for the upload!

    • @hnasr
      @hnasr  5 років тому

      inadaizz haha very happy to help!

  • @sarcaastech
    @sarcaastech Рік тому

    Done ✔️ thanks for knowledge 🙏

  • @sharonwigwe55
    @sharonwigwe55 4 роки тому +1

    great video. Very nicely explained!

  • @LifeOfVikram
    @LifeOfVikram 3 роки тому

    async is more beneficial, cuz we can execute codes & we don't have to wait for the results. we can test all classes and functions in code

  • @vikasni95
    @vikasni95 5 років тому

    Wow ur just amazing sir... Salute to u.. World wants a good explainer like u

    • @hnasr
      @hnasr  5 років тому

      vikas vik's your comment means alot thank you for taking the time and watching :)

  • @ayoonamusi1067
    @ayoonamusi1067 4 роки тому +1

    thank you for making this video

  • @becauseicare630
    @becauseicare630 5 років тому +1

    Very well explained...Thanks

  • @qingbusiness6713
    @qingbusiness6713 2 місяці тому

    Beautiful👌🏽

  • @0x00-e2v
    @0x00-e2v 5 років тому +1

    thanks brother, this was helpful

    • @hnasr
      @hnasr  5 років тому

      Thanks! Glad you enjoyed it :) let me know what other software engineering concepts you would like me to make. Cheers!

  • @yuxiangzhang2343
    @yuxiangzhang2343 5 років тому +1

    thank you, very clear explanation

    • @hnasr
      @hnasr  5 років тому

      Yuxiang Zhang thank you for watching 😊

  • @talpatramammabono6842
    @talpatramammabono6842 5 років тому

    bro your english accent is so good ......

    • @hnasr
      @hnasr  5 років тому

      talpatra mammabono thank you , watch my first video ok youtube (sort by date) my english was so bad 4 years ago ... practice makes better, still ways to go

  • @mohamedsaif1928
    @mohamedsaif1928 5 років тому

    عظيم يا صديقي ..

    • @hnasr
      @hnasr  5 років тому

      mohamed saif تسلم عزيزي

  • @anithasudha5453
    @anithasudha5453 5 років тому

    Very good explanation with examples😊😊

    • @hnasr
      @hnasr  5 років тому

      thanks Anita! glad you enjoy the content

  • @Raisulkibria0
    @Raisulkibria0 5 років тому

    thx for your help i can pass my exams now

    • @hnasr
      @hnasr  5 років тому +1

      Raisul Kibria all the best in your exams! 😊

  • @Joshrivers2010
    @Joshrivers2010 2 роки тому

    There's another way you could pronounce Asynchronous, that's ASYNC

  • @galfrasian
    @galfrasian 3 роки тому

    Thanks a ton.!!!

  • @jackdreamer499
    @jackdreamer499 5 років тому

    Well Explained really helpful Thanks! :)

    • @hnasr
      @hnasr  5 років тому

      Jack Dreamer thanks for watching Jack! :)

  • @medAmineRg
    @medAmineRg 4 роки тому

    thanks bro !

  • @wahidgunit
    @wahidgunit 5 років тому

    very nicely Explained !

    • @hnasr
      @hnasr  5 років тому

      Abdul Wahid Pasha thanks! 🙏

  • @hackeroverflow5954
    @hackeroverflow5954 5 років тому

    Good one!

  • @proogenji7526
    @proogenji7526 5 років тому

    thanks! this is very helpful

    • @hnasr
      @hnasr  5 років тому

      ProoGenji glad I could help :)

  • @aileenapon6838
    @aileenapon6838 3 роки тому

    Yes

  • @sayurirathnayake291
    @sayurirathnayake291 3 роки тому

    thank u

  • @mohamedibrahims9217
    @mohamedibrahims9217 5 років тому

    Good explanation... :-)

  • @darkmusky9851
    @darkmusky9851 4 роки тому +1

    Ugh finally not an Indian accent lol

  • @eldhosevj9924
    @eldhosevj9924 4 роки тому

    Great

  • @mahmedfarid3201
    @mahmedfarid3201 5 років тому +4

    hahahahah You are Awesome

  • @cipherphinx
    @cipherphinx 5 років тому

    I understand now why PHP sucks.

  • @chrisy.703
    @chrisy.703 2 роки тому

    too wordy... for the content u wanna deliver... U can simply cut into 3 mins....

  • @vSlurpeh
    @vSlurpeh 5 років тому

  • @aileenapon6838
    @aileenapon6838 3 роки тому

    Yes