News for hackers. Stuff that matters.
Re:Comparison of the Go and Erlang concurrency models (2011) by 4ad on Thursday December 04, 2014 @05:27AM (#8698628)
Pretty good article, but a few things stood out to me as questionable:

> In the CSP model, message delivery is instantaneous and synchronous. The Go implementation is slightly different: Messages are buffered in channels in much the same way that Erlang buffers messages for delivery to processes. [...] Go unfortunately misses out on one of the things that makes CSP easy to reason about. The synchronous nature of CSP message-passing [...].

Go has both buffered and unbuffered channels; unbuffered channels are the default. Most code uses unbuffered channels, because, as the author correctly points out, unbuffered channels are much easier to reason about.

Sometimes you do want buffered channels though, although you quite often want a buffer size of only one or two.

Buffered channels are the reason why goroutines are not coroutines in the traditional sense (there was a sibling question asking about that). Unbuffered channels and GOMAXPROCS=1 (the default) give you coroutines. Go gives you more if you need it.

There are no comments on this comment yet.