• platypus_plumba@lemmy.world
    link
    fedilink
    arrow-up
    6
    ·
    10 hours ago

    Do we really need a video about this in 2024? Shouldn’t this be already a core part of our education as software engineers?

  • doughless@lemmy.world
    link
    fedilink
    arrow-up
    36
    ·
    1 day ago

    A comment on the YouTube video makes a good point that we already have a better word for the concept of dealing with multiple things at once: multitasking. Using a word that literally means “things happening at the same time” just adds to the confusion, since people already have a difficult time understanding the distinction between multitasking and concurrency.

    • FizzyOrange
      link
      fedilink
      arrow-up
      19
      ·
      1 day ago

      Yeah it always bothered me that they’re saying “concurrency is not concurrency”.

      I’m going to start using “multitasking” instead. That’s so much better. Who’s with me?

      • doughless@lemmy.world
        link
        fedilink
        arrow-up
        5
        ·
        20 hours ago

        I will typically use the terms asynchronous and parallel when discussing the concepts, but I hadn’t thought about using multitasking until I saw that comment. I mean, even C# calls them “tasks”.

    • FrostyPolicy@suppo.fi
      link
      fedilink
      arrow-up
      6
      arrow-down
      9
      ·
      edit-2
      1 day ago

      A cpu (core) can only do one thing at a time. When you have multiple cores you can do multiple things at the same time. Multitasking in programming sense is a bad term, it’s a term more for the masses.

      Bit simplified:

      • concurrency: you seem to be doing multiple things at the same time. In reality they are run little by little one after another. Doesn’t really speed things up.
      • parallelism: you actually run multiple things at the same time (multiple cpus/cpu cores required). If the code scales properly or is designed to truly run in parallel the speed up is relative to the number of cpus available.

      Edit: It’s much more complex subject then I’ve presented here.

      • BB_C
        link
        fedilink
        arrow-up
        3
        ·
        4 hours ago

        With hyper-threading and preemption in mind, maybe it’s concurrency all the way down 😎 . But we should definitely keep this on the down low. Don’t want the pesky masses getting a whiff of this.

      • FizzyOrange
        link
        fedilink
        arrow-up
        18
        ·
        1 day ago

        You missed the point. He understands all these things you tried to explain. The point is that your definition of the word “concurrency” is objectively wrong.

        You:

        you seem to be doing multiple things at the same time. In reality they are run little by little one after another

        The actual meaning of the word “concurrency”:

        The property or an instance of being concurrent; something that happens at the same time as something else.

        Wiktionary actually even disagrees with your pedantic definition even in computing!

        (computer science, by extension) A property of systems where several processes execute at the same time.

        I suspect that concurrency and parallelism were actually used interchangeably until multicore became common, and then someone noticed the distinction (which is usually irrelevant) and said “aha! I’m going to decide that the words have this precise meaning” and nerds love pedantic "ackshewally"s so it became popular.

        • FrostyPolicy@suppo.fi
          link
          fedilink
          arrow-up
          1
          ·
          7 hours ago

          Wikpedia puts it nicely:

          "The concept of concurrent computing is frequently confused with the related but distinct concept of parallel computing,[3][4] although both can be described as “multiple processes executing during the same period of time”. In parallel computing, execution occurs at the same physical instant: for example, on separate processors of a multi-processor machine, with the goal of speeding up computations—parallel computing is impossible on a (one-core) single processor, as only one computation can occur at any instant (during any single clock cycle).[a] By contrast, concurrent computing consists of process lifetimes overlapping, but execution does not happen at the same instant. "

        • nous
          link
          fedilink
          English
          arrow-up
          10
          ·
          23 hours ago

          I suspect that concurrency was used back when there were only single threaded cpus, when process scheduling became a thing, to talk about the difference between running one process after another vs interleaving the processes so they appear to be concurrent. Then once true multithreaded programs became a thing they needed a new word to describe things happening at the exact same time instead of only appearing to.