Hacker News new | past | comments | ask | show | jobs | submit login

Question re: only utilizing one CPU and GOMAXPROCS: would it be in bad taste to, by default, for a program which might be used by other people (and uses goroutines extensively) to include in initialization "runtime.GOMAXPROCS(runtime.NumCPU())"?



I asked this on the freenode #go-nuts channel. The consensus was no. 1) Not every program benefits from this. 2) It's hoped that this will be deprecated soon hopefully.


C or Java programs use all cores by default. I think it's reasonable for Go to have the same default.


C, previous to C11, didn't even have a concept of threading...

(And who the hell is using C11 like that anyway?)


OK, pthreads.


It is going to be a pretty hard sell that mimicking pthreads is ever a good idea...

Regardless, considering the casual nature of goroutines and the deliberate heavy-weight nature of pthreads, I find it hard to see pthreads as being any sort of argument about what Go should do, regardless of pthreads' shortcomings. They are wildly different animals.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: