3 ms·
I don't see why blocking is an issue given that goroutines are light weight threads. They are really cheap and can be created as needed, eliminating much of the
by api 8y ago
I don't see why blocking is an issue given that goroutines are light weight threads. They are really cheap and can be created as needed, eliminating much of the need for async patterns. It's one of the nicest things about Go given that async is just manually implemented lightweight threading.
I would say though that go channels have not turned out to be as useful as I thought they would be. I dont find myself using them that much. But maybe it's just my style or the type of stuff I am writing.
- ec109685 8y agoLightweight threads are different than async models. With the latter work continues until io or a manual yield happens. With threads, your workload can be preempted outside your control.
- jstewartmobile 8y agoBlocking is a pretty big deal. With something like pipes or sockets, there are timeouts and saner handling of breakages. With Go channels, one false move, and you've got a panic or an infinite wait. I like Go, just not a big fan of channels.
- pcwalton 8y ago> It's one of the nicest things about Go given that async is just manually implemented lightweight threading. No, async/await is typically stackless, while goroutines have stacks. That's a significant difference.
- littlestymaar 8y agoBlocking implies you can get deadlocks if you're not cautious, whereas with async you just can't.