КОМЕНТАРІ •

  • @dejanualex
    @dejanualex 3 місяці тому +130

    "Concurrency is about dealing with lots of things at once. Parallelism is about doing lots of things at once." R. Pike

    • @Rishi_Khandelwal
      @Rishi_Khandelwal 2 місяці тому +3

      What do you mean by dealing and doing? Please clarify.

    • @dejanualex
      @dejanualex 2 місяці тому +1

      @@Rishi_Khandelwal Although concurrency and parallelism are related concepts in terms of concurrent programming and can be used together, they aren't the same thing. Concurrency = multiple tasks that start/run/complete in overlapping time periods and in no specific order. vs. Parallelism = multiple tasks that run at the same time.

  • @gus473
    @gus473 3 місяці тому +16

    Appears you're on a path to have 1,000,000 subscribers by year-end! Hoping you make it! 🍻😎✌️

  • @janbodnar7815
    @janbodnar7815 2 місяці тому +5

    Great explanation. I would add a couple of remarks. You have to be aware that these terms may be used differently, people sometimes mixed them up. Or some use a different terminology. For instance, .NET uses the terms synchronous and asynchronous.
    I came across this definition of concurrency: concurrency means that two or more calculations happen within the same time frame. Meaning, several tasks run (with context switching) within a period of say 3 minutes. Managing multiple tasks simultaneously (within a time frame) is a good definition as well.
    IO-heavy and CPU-heavy is often referred to as IO-bound and CPU-bound. There is also the multitasking term, which is a more informal term that overlaps with both concurrent and parallel.
    Concurrency is an umbrella term for both concurrent and parallel execution. Parallel execution is a specific case of concurrency. But when they say the tasks runs concurrently, it means they run in interleaved, non-parallel way.
    This video is so good that I recommend to rewatch it any time a confusion arises.

    • @sylvereleipertz955
      @sylvereleipertz955 25 днів тому

      The terms sync and async are separate concepts. Async is achieved differently depending on the language. Using JS, async code is implemented using concurrency since JS is single threaded. On the other hand, if you use Java, async code is executed on a separated thread, making it parallel but not concurrent.

  • @vijayas8007
    @vijayas8007 3 місяці тому +43

    Concurrency is abt managing and parallelism is abt executing

    • @wexwexexort
      @wexwexexort 3 місяці тому +1

      wtf is abt

    • @dy0mber847
      @dy0mber847 3 місяці тому +2

      ​@@wexwexexortabout i guess

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

      @@dy0mber847 lol, that makes sense.

  • @dawidkrol1
    @dawidkrol1 3 місяці тому +7

    Thank you for explaining concurrency and parallelism in understable way.

  • @xxRAP13Rxx
    @xxRAP13Rxx Місяць тому

    Great video!
    Is there an alternative to context switching where the CPU Core focuses solely on one task continuously until that task blocks so the CPU Core can focus on a separate task? I believe the JavaScript event loop behaves similarly to this alternative.

  • @web9529
    @web9529 3 місяці тому

    Clear and concise with good animations, great video!

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

    So is it right when I say concurrency is better for multiple network call, like reading from a database, using concurrency, and based on each of the results returned, i can handle simultaneous computations using parallelism?

  • @ottohavasvolgyi2448
    @ottohavasvolgyi2448 10 днів тому

    So with Node.js only concurrency is possible, because it is single threaded?

  • @je_suis_onur
    @je_suis_onur 3 місяці тому

    When talking about multi-cores or multi-cpus for doing parallel tasks the most important thing to watch out for would the cpu/core cache coherency. It would've been nice to touch on that too. Keep up the good work though! Cool video.

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

    How do you do parallelism while maintaining order? Is it possible?

  • @Zmey5656
    @Zmey5656 3 місяці тому +2

    In the Go language, parallelism and concurrency are often confused

  • @anissbenthami
    @anissbenthami 8 днів тому

    The best explanation

  • @tobiassjoholm9325
    @tobiassjoholm9325 3 місяці тому +9

    This is wrong?
    Concurrency on multiple CPU cores enables parallel execution.
    Concurrency on a single CPU core requires switching.
    Parallelism is a subset of concurrency.

    • @mohammedgoder
      @mohammedgoder 3 місяці тому +3

      Absolutely.
      Yeah, people try to redefine words that already have a definition.
      Concurrent literally means at the same time.
      I will never understand the followers that just go with it without thinking "is he correct?"

  • @psycho.2u
    @psycho.2u 3 місяці тому

    All we can do with a programming language ( such as C#, Java, python ) is to write a concurrent program. And when we run them on a machine, it may run parallelly or not. This is decided by the OS which decides it based on the hardware availability
    In these languages, we don't have much control to forcefully run tasks in truly parallel manner. These programming languages abstract away those details
    Is the above understanding right?

    • @RoyoItakoride
      @RoyoItakoride 2 місяці тому +1

      I am thinking the same way too. I encourage you to read Grokking concurrency By Kirill Bobrov for deeper explanation regarding this topic :D

    • @janbodnar7815
      @janbodnar7815 2 місяці тому +1

      Yes, to my understanding, this is the case. If you let's say call Parallel.ForEach in C#, you give a hint to the OS that you would like to run it in parallel, if possible.

  • @TheArmenianSolider65
    @TheArmenianSolider65 3 місяці тому

    I was asked to explain this concept recently in my system design interview at Disney for what was essentially implement Launch Darkly

    • @Obie.
      @Obie. 3 місяці тому

      I see you didn’t get the job

  • @TheIronMan9
    @TheIronMan9 3 місяці тому

    Hello Sir, as and always Thanks for the great content. Please make a video on ACTOR SYSTEM.

  • @rammehar5531
    @rammehar5531 3 місяці тому

    Thank you very much for all the knowledgeable videos. We respect your efforts. Please make a video on system design of online coding judge, how leetcode or hacker rank handles the online contest's load.

  • @Tony-dp1rl
    @Tony-dp1rl 3 місяці тому

    It's kinda a blurry line now though, for most development, your software is running virtualized anyway. .

  • @s8x.
    @s8x. 2 місяці тому +2

    parallelism is a type of concurrency

  • @geetalohiya8692
    @geetalohiya8692 3 місяці тому

    sir please make video on topin web application on protocal because I didn't learn on any kind of video so plz thinking to make it

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

    Thank you for doing this!

  • @emmaccen
    @emmaccen 3 місяці тому +5

    paraconcurrent should be a word.

  • @nanonkay5669
    @nanonkay5669 3 місяці тому +1

    Using Go made me understand this better

  • @oealias5584
    @oealias5584 3 місяці тому

    in the 2nd 'concurrent, not parallel', if task A and task B are running in sequence (one after the other) they can't finish at the same time. am i missing something?

    • @Thomas-cr2pt
      @Thomas-cr2pt 3 місяці тому

      your statement is correct. but you should see it more like this. a has 10 jobs, b has 10 jobs. If you do those alternate you end up done at roughly the same time (for a and b). Thats why the chef making 3 dishes is a good example.

  • @Testmail-lu8tl
    @Testmail-lu8tl 3 місяці тому

    Concurrency to enable parallelism...nice idea to ponder

  • @franciscoalbertomm7768
    @franciscoalbertomm7768 3 місяці тому

    you are very good, thanks so much for all

  • @rajdippal51
    @rajdippal51 3 місяці тому

    Multitasking vs Multiprocessing

  • @3a146
    @3a146 3 місяці тому

    Concurrency is a computer to listen multiple users, while parallelism is a user to call multiple computers. The difference is who takes control.

  • @hirenpatel6118
    @hirenpatel6118 3 місяці тому

    then there is also cooperative and preemptive

  • @DK-ox7ze
    @DK-ox7ze 3 місяці тому +2

    Isn't this a repeat?

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

    Parallelism is subset of concurrency

  • @LuisAntolin
    @LuisAntolin 3 місяці тому

    Just brilliant!

  • @vnit4security
    @vnit4security 3 місяці тому

    Nice Tut. Thanks 🍓🍓🍓

  • @MrAtomUniverse
    @MrAtomUniverse 3 місяці тому +9

    What software did you use to draw those diagrams ?

  • @tonym5857
    @tonym5857 3 місяці тому +1

    Youe content awesome 👏👏👏👏

  • @pranavsarang
    @pranavsarang 3 місяці тому +1

    What if one task depends on another during parallelism. Thanks for the video

    • @KameOuss
      @KameOuss 3 місяці тому +4

      In this case, I think you have no other choice but to wait for the task to finish

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

    multitasking is concurrency, slavery is parallelism. Probably.
    edit : parallel -> parallelism. i ain't native

  • @nc8051
    @nc8051 3 місяці тому

    Nice

  • @ripple123
    @ripple123 3 місяці тому +1

    nice its funny how many devs still get these confused

    • @mohammedgoder
      @mohammedgoder 3 місяці тому +1

      Funny that you seem to be one of these devs; considering that he's wrong.
      Concurrent literally means at the same time.

  • @Artur_Martins
    @Artur_Martins 3 місяці тому +2

    01:48 (nitpick) - task 1.2 appears twice on the top.

  • @brianquigley1940
    @brianquigley1940 3 місяці тому

    👍 👍 👍 👍

  • @quang.luu.179
    @quang.luu.179 3 місяці тому

    👍👍👍

  • @danielnistor5857
    @danielnistor5857 3 місяці тому

    123