‹ BackHN Continuity

Thread

Go Concurrency Distilled

402 points · 187 comments · chmaynard

  1. voidfunc · · focus · HN ↗
    Ive been writing Go for over a decade and I still feel like I never quite "got" channels. Every time I use them I need to go consult the manual, and none of the patterns feel obvious which is weird considering the rest of the language feels very obvious.

    Too many years of Java and managing Threads and Runnables probably rotted my brain.

    1. liampulles · · focus · HN ↗
      It depends really on what you actually want to do. I tend to make a few helper funcs for different kinds of things I want to do. For example, a helper funcs to accept anonymous job funcs and collect output. Then you can compose programs out of those higher level blocks.
Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.