$ for _ in `seq 0 10000`; do gtree template; done | gtree output --massive
$ ps a -o pid,nlwp,args | grep "gtree output" | grep -v grep
8376 7 gtree output --massive
- 実際には7つのスレッドしか使われていないが、7つしか並行処理しているわけではなく、Goのランタイムが効率的にCPUコアを使っている。
- goroutineがCPUの1コアを占有するわけではない。
- 「Go言語 プログラミングエッセンス」P146,147参照