‹ 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. chimbambum · · focus · HN ↗
      any downsides to it in your experience?
      1. Joel_Mckay · · focus · HN ↗
        Go and Julia are fun languages.

        In production, Go has proven solid for several years. It is best when used with the native code people ported.

        There are only two issues I encountered:

        1. getting the legacy ancient C source meta-circular Go compiler working to port the Go boot-strap compiler upgrade chain is a kick in the pants. However, once it is on a architecture it has proven rather resilient.

        2. memory limited systems can develop reliability issues, as Go programs will often ungracefully throw hard to diagnose unrelated errors during each crash. A good metric is 3:1 of your average load as a safety margin (if you see 2GiB in average RAM use, make sure to over-provision the host with 8GiB RAM etc.)

        Other than the above short list of edge cases, if you join a pure Go project it is usually pretty reliable. Most community folks interested in the language seem fairly competent at building stuff that is fun. =3

        1. SamInTheShell · · focus · HN ↗
          I found Go memory issues easier to solve than Java issues. You can see an example with etcd used in Kubernetes. I had to enable performance profiling in etcd to identify why it was eating up all the memory. It led me to a specific partition of keys that tracked back to a specific object type in Kubernetes.

          It was literally enabling a flag and running some commands to do some really quick exports.

          Dealing with the JVM though, heap dumps are slow to process and the UI I had to download was very clunky. I don't know if there are better tools, but even if there are the path to just doing it isn't straight forward.

          1. Joel_Mckay · · focus · HN ↗
            The potential of Java/OOP died with Sun as far as I am concerned. =3
            1. gf000 · · focus · HN ↗
              You might want to stay concerned, as you are more than 2 decades outdated then.
              1. Joel_Mckay · · focus · HN ↗
                Don't let Googles necromancy fool you, most of the use-cases have been deprecated. Have a great day =3

                Rule #23: Don't compete to be at the bottom, as you just might actually win.

Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.