package main
import (
"bufio"
"net/http"
_ "net/http/pprof"
"os"
"time"
)
func main() {
go func() {
http.ListenAndServe(":8080", nil)
}()
reader := bufio.NewReader(os.Stdin)
for i := 0; i < 100; i++ {
go func(id int) {
for {
data, _, _ := reader.ReadLine()
println(id, string(data))
}
}(i)
time.Sleep(1 * time.Second)
}
println("create finish!")
time.Sleep(5 * time.Second)
}
I use curl http://localhost:8080/debug/pprof/threadcreate see that the
theadcreate num is always grow.
want to ask when the runtime decide to threadcreate : long time not
return syscall ? any others ??
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.