New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
runtime: GOMAXPROCS has outdated information #41275
Comments
Change https://golang.org/cl/253537 mentions this issue: |
Neither of those statements is incorrect or outdated. The first statement is correct. Not entirely sure why it is in the It's always been a desire to have the scheduler adjust its processor use automatically, so that |
@randall77, thank you for your comment. The issue that I was trying to describe is located in the description of the method which gives an example of how to use it. I remember the time when we had to explicitly call it in order to make async code work, now this call can be omitted and it simply makes no sense calling it with an argument |
Where is that? It's not in the
You're right that a call to But there's a big difference between "can be omitted" and "must be omitted". It's not hurting anything to leave it there. To be clear, I'm happy with changing the description to say that
I'm not sure either. But someone at some point decided this was worth saying. I'm willing to give them the benefit of the doubt, if for no other reason than it introduces some hysteresis to doc changes so we don't keep changing our minds about it every release. |
I meant to say that you can interpret these doc comments like an example of how to use it.
I'd say that unnecessary call of the code instructions that makes no changes is already hurting us if we want to make things as good as we can. The whole point I'm trying to make is that by reading current docs for this function you can misunderstand the usage of it. For me, it happened while I was reviewing the code. I checked the docs to make sure that I correctly remember that there was a change that |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
yes
What did you do?
Read a documentation of runtime.GOMAXPROCS
What did you expect to see?
According to go1.5 release notes there's no need anymore to explicitly call this function at the start of any golang application to set the maximum number of CPUs equal to
runtime.NumCPU
.What did you see instead?
The number of logical CPUs on the local machine can be queried with NumCPU. This call will go away when the scheduler improves.
is outdated.Git blame tells that the last modification to this doc comments was made 9 years ago and it may confuse some users.
The text was updated successfully, but these errors were encountered: