Re:Go hits the concurrency nail on the head
by wahern on Monday October 08, 2018 @09:25PM
(#18172675)
You're not understanding (or at least not appreciating) the function color problem mentioned in the article. See, e.g., http://journal.stuffwithstuff.com/2015/02/01/what-color-is-y...
Re:Go hits the concurrency nail on the head
by apta on Thursday October 11, 2018 @11:09PM
(#18198885)
I read that article before. Here's the thing, the only thing that the "go" keyword makes easier is having the ability to have any arbitrary function run in a green thread without having to modify it's signature. However, the moment you want to actually do something useful with it (e.g. communicate with it, cancel it, or read its returned value), you're going to have to pass a channel (or more) or a waitgroup to it anyway, modifying its signature and changing its "color". The issue remains pretty much the same.
I don't see how:
Is any more difficult than: As a matter of fact, the first one is much easier. I don't have to create and pass a channel, and manually handle returning a success or failure. The first approach is much better