4 ms·
Goroutines are still pretty darn light-weight and relatively "easy" to use. Compared to processes and threads, you can spawn thousands+++ with sane defaults and
by loopz 7y ago
Goroutines are still pretty darn light-weight and relatively "easy" to use. Compared to processes and threads, you can spawn thousands+++ with sane defaults and minimal overhead on crappy hardware. Having decent stdlib-support for things like mutexes and sync.pool, means using what works. But yeah, channels and "synchronization by communicating" was heavily oversold, more as a cool idea than anything to cargo-cult. There are many other mechanisms offered in standard lib that may be used to improve scalability and performance. Overall, Golang is overall "good" in many areas, do have some snags (but like in C/C++ these provides you with some lower-level control), though will not approach C-performance. So it's a trade-off to be able to use those sane defaults until bigger foot-guns are really, really required (avoiding premature optimizations).
- Animats 7y agoThey're really "green threads" or "fibers". Remember those? With a good way to avoid blocking on system calls, which Go has, it's a much simpler way to do sequential operations. No need for state machines, "promises", "futures", "async", or all the other hacks used to hammer an event driven model into a sequential model.
- loopz 7y agoGoroutines are multiplexed by M:N scheduler and do not belong to a particular OS thread, so the builders chose a custom name for it.