3 ms·
Golang: to enable all the cores, you have to put in your code runtime.GOMAXPROCS(num of cores you want to use) This is no longer true. With Go 1.5 and higher G
by sudorandom 11y ago
Golang: to enable all the cores, you have to put in your code runtime.GOMAXPROCS(num of cores you want to use)
This is no longer true. With Go 1.5 and higher GOMAXPROCS is set to the number of CPUs available by default.
- grigio 11y agoYeah, I've read somewhere it should be the default behavior in Go 1.5, but currently it isn't, at least not in my system. If I don't specify it all the computation use just one core
- sudorandom 11y agoThis hasn't been my experience... You can also set that value using an environmental variable (GOMAXPROCS). You might want to make sure that isn't set in your environment. Otherwise, you might be experiencing a bug that you should probably report. Reference: https://golang.org/doc/go1.5 https://golang.org/doc/go1.5