Golang的纤程耗费
每纤程groutine 大约8K 内存// Concurrent computation of pi.// See https://goo.gl/la6Kli.//// This demonstrates Go's ability to handle// large numbers of concurrent processes.// It is an unreasonable way to calculate pi.package mainimport ( "bufio" "fmt" "math" "os" "sync")var w sync.WaitGroupfunc main() { fmt.Println(pi(10000))}// pi launches n goroutines ...阅读全文