{"action":"created","issue":{"url":"https://api.github.com/repos/golang/go/issues/11609","labels_url":"https://api.github.com/repos/golang/go/issues/11609/labels{/name}","comments_url":"https://api.github.com/repos/golang/go/issues/11609/comments","events_url":"https://api.github.com/repos/golang/go/issues/11609/events","html_url":"https://github.com/golang/go/issues/11609","id":93202524,"number":11609,"title":"runtime: NumCPU does not change when process affinity changes","user":{"login":"marcosnils","id":1578458,"avatar_url":"https://avatars.githubusercontent.com/u/1578458?v=3","gravatar_id":"","url":"https://api.github.com/users/marcosnils","html_url":"https://github.com/marcosnils","followers_url":"https://api.github.com/users/marcosnils/followers","following_url":"https://api.github.com/users/marcosnils/following{/other_user}","gists_url":"https://api.github.com/users/marcosnils/gists{/gist_id}","starred_url":"https://api.github.com/users/marcosnils/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcosnils/subscriptions","organizations_url":"https://api.github.com/users/marcosnils/orgs","repos_url":"https://api.github.com/users/marcosnils/repos","events_url":"https://api.github.com/users/marcosnils/events{/privacy}","received_events_url":"https://api.github.com/users/marcosnils/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/golang/go/milestones/24","html_url":"https://github.com/golang/go/milestones/Go1.6","labels_url":"https://api.github.com/repos/golang/go/milestones/24/labels","id":1096159,"number":24,"title":"Go1.6","description":"","creator":{"login":"josharian","id":67496,"avatar_url":"https://avatars.githubusercontent.com/u/67496?v=3","gravatar_id":"","url":"https://api.github.com/users/josharian","html_url":"https://github.com/josharian","followers_url":"https://api.github.com/users/josharian/followers","following_url":"https://api.github.com/users/josharian/following{/other_user}","gists_url":"https://api.github.com/users/josharian/gists{/gist_id}","starred_url":"https://api.github.com/users/josharian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josharian/subscriptions","organizations_url":"https://api.github.com/users/josharian/orgs","repos_url":"https://api.github.com/users/josharian/repos","events_url":"https://api.github.com/users/josharian/events{/privacy}","received_events_url":"https://api.github.com/users/josharian/received_events","type":"User","site_admin":false},"open_issues":287,"closed_issues":322,"state":"open","created_at":"2015-05-05T02:39:06Z","updated_at":"2015-11-23T16:54:09Z","due_on":"2016-01-31T08:00:00Z","closed_at":null},"comments":5,"created_at":"2015-07-06T06:33:45Z","updated_at":"2015-11-23T18:37:28Z","closed_at":null,"body":"I have a 32 core linux system and suddenly I found that NumCPU() was returning only two. After discussing about this in the slack channel we've realized that the Go process had a CPU affinity and only two processors were assigned to the process. \r\n\r\nAccording to documentation I'd expect NumCPU() to return the amount of logical cores in the system independently of the process affinity. Also this might bring confusion as we've seen NumCPU() returning different values depending on the underlying platform. \r\n\r\nSeems like either the docs need to be updated clarifying what NumCPU() does or implementation should be consistent among different platforms (taking into account process affinity or not).\r\n\r\nIn addition, it seems like Go only performs the check once. If the user changes the CPU affinity, NumCPU won't change"},"comment":{"url":"https://api.github.com/repos/golang/go/issues/comments/159022692","html_url":"https://github.com/golang/go/issues/11609#issuecomment-159022692","issue_url":"https://api.github.com/repos/golang/go/issues/11609","id":159022692,"user":{"login":"rsc","id":104030,"avatar_url":"https://avatars.githubusercontent.com/u/104030?v=3","gravatar_id":"","url":"https://api.github.com/users/rsc","html_url":"https://github.com/rsc","followers_url":"https://api.github.com/users/rsc/followers","following_url":"https://api.github.com/users/rsc/following{/other_user}","gists_url":"https://api.github.com/users/rsc/gists{/gist_id}","starred_url":"https://api.github.com/users/rsc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rsc/subscriptions","organizations_url":"https://api.github.com/users/rsc/orgs","repos_url":"https://api.github.com/users/rsc/repos","events_url":"https://api.github.com/users/rsc/events{/privacy}","received_events_url":"https://api.github.com/users/rsc/received_events","type":"User","site_admin":false},"created_at":"2015-11-23T18:37:28Z","updated_at":"2015-11-23T18:37:28Z","body":"It sounds like the only part left here is documenting that Go checks the available CPUs at startup and does not rescan them periodically.\r\n"}}