3 ms·
Goroutines running Go code are multiplexed onto a variable number of system threads (GOMAXPROCS, in the gc implementation), Goroutines running C code, for examp
by 4ad 14y ago
Goroutines running Go code are multiplexed onto a variable number of system threads (GOMAXPROCS, in the gc implementation), Goroutines running C code, for example via cgo, or when they call a blocking system call, have their own thread.
- realrocker 14y agoYes I get that. I just wanted to point out that a single threaded model is not necessarily a bad thing. It happens in GO too by default.
- strmpnk 14y agoI think that's more of a matter of scheduler still being immature. Erlang only added an SMP scheduler in R11 due to the complexities of managing internal state without sacrificing it's soft-realtime abilities. It was also only really reliable after R12. I'm sure Go will mature here and the defaults will evolve along with that. Whether that will take years or not is up for debate but at least it's a possibility and doesn't cost the programmer anything other than a recompile if they start with careful use of goroutines today.
- Jabbles 14y agoI believe the number of threads can be higher than GOMAXPROCS, but only GOMAXPROCS can be running at once. https://groups.google.com/d/topic/golang-nuts/bP6_KD51ed4/discussion https://groups.google.com/d/topic/golang-nuts/bP6_KD51ed4/di...