‹ 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. za3faran · · focus · HN ↗
      Java is doing it better (virtual threads + structured concurrency + immutable records and immutable value types).

      Not to mention golang is not memory safe: <a href="https:&#x2F;&#x2F;www.ralfj.de&#x2F;blog&#x2F;2025&#x2F;07&#x2F;24&#x2F;memory-safety.html" rel="nofollow">https:&#x2F;&#x2F;www.ralfj.de&#x2F;blog&#x2F;2025&#x2F;07&#x2F;24&#x2F;memory-safety.html

      1. jeremyjh · · focus · HN ↗
        Java&#x27;s virtual threads are not preemptive. Yes there is a paper where they call them preemptive but they define the term differently to claim it. Code stuck in a tight loop is not preempted.
        1. gf000 · · focus · HN ↗
          Well, go preempts at function calls, does it not? So a CPU-heavy inner loop calculating everything will fail to preempt in both languages - is this really a hill worth dying on?

          Quite obviously the meaningful distinction is from manually inserted preempt points, like async&#x2F;await languages.

          1. Jtsummers · · focus · HN ↗
            &gt; So a CPU-heavy inner loop calculating everything will fail to preempt

            They fixed that in Go a while ago.

            <a href="https:&#x2F;&#x2F;go.dev&#x2F;doc&#x2F;go1.14#runtime" rel="nofollow">https:&#x2F;&#x2F;go.dev&#x2F;doc&#x2F;go1.14#runtime

Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.