‹ BackHN Continuity

Thread

Go Concurrency Distilled

402 points · 187 comments · chmaynard

  1. SamInTheShell · · focus · HN ↗
    The concurrency and threading in Go just feels like magic compared to every other language. I'm a goroutine addict and I refuse to be rehabilitated.

    Just from observations over the years, I don't think there's any other language quite like this, in terms of how things can end up happening in any thread.

    1. hank1931 · · focus · HN ↗
      How about Erlang or Elixir using BEAM?

      Supposedly WhatsApp scaled to serving over 1 billion users with Erlang and BEAM.

      RabbitMQ, used by Reddit, uses Erlang and BEAM.

      Discord uses Elixer and BEAM.

      I just traveled down the BEAM rabbit hole. Fascinating story. The Ericsson Computer Science Laboratory cranked out some amazing products in the early 1990's.

      Their goal was five nines of reliability for Ericsson telephone switches.

      According to Joe Armstrong (an interesting fellow from Ericsson), the AXD301 ATM switch achieved nine nines over a nine-month period using Erlang and BEAM in 2002. That calculates out to 24 milliseconds of downtime.

      1. CoolestBeans · · focus · HN ↗
        BEAM+OTP is a masterclass in using concurrency to achieve fault tolerance. But Go achieves its "magic" by feeling like the lingua francas of programming, C and C++. Go doesn't make the developer learn too many new concepts. The runtime is self enclosed in the final binary. This commitment to the familiar programming patterns also means it allows for concurrency anti-patterns like shared memory which for Erlang+OTP's design principles is verboten.
        1. gf000 · · focus · HN ↗
          I mean, Java does it even more elegantly imo and if anything it is the most stereotypical oop programming language of all time.
          1. smw · · focus · HN ↗
            Can you explain how you think Java does it more elegantly? That's a very surprising statement. Java didn't even do m:n threading until "Project Loom".
            1. za3faran · · focus · HN ↗
              Java has structured concurrency.

              This poster summarized it well: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=49864334">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=49864334

Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.