Hacker News new | ask | show | jobs
by sudorandom 3851 days 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.
1 comments

Yeah, 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

This 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