‹ BackHN Continuity

Thread

Go Concurrency Distilled

402 points · 187 comments · chmaynard

  1. Jeeetendra · · focus · HN ↗
    honestly the hard part of go concurrency was never starting goroutines, it's making cancellation and shutdown behave. nice to see context, races and diagnostics in one runnable place.
    1. kccqzy · · focus · HN ↗
      Yup. That’s because cancellation isn’t native, but part of the context object and requires cooperation. In a language where goroutine switching is preemptive rather than cooperative, I find it odd to have cooperative cancellation, until I realize that Go doesn’t have exceptions and probably will never have them.
      1. Jeeetendra · · focus · HN ↗
        exactly - once you accept go has no exceptions, context cancellation is basically the least bad way to tell a goroutine to stop.
Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.