Skip to content
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

Provide an API to expose the read value without setting GOMAXPROCS #29

Open
ajwerner opened this issue Jul 15, 2020 · 3 comments
Open

Comments

@ajwerner
Copy link

The logic to read the core count from cgroups is very valuable. In some settings it might be desirable to read the value but not set GOMAXPROCS with it. This issue requests that maxprocs subpackage provide a method that returns the read value without setting the runtime value.

@prashantv
Copy link
Contributor

Once an API is exposed, it has to remain backwards compatible, so we need to make sure that:

  • The API we want to expose belongs in automaxprocs (should it be a separate repository / module?). CGroup parsing is a dependency of automaxprocs, but not necessarily something that has to be coupled to automaxprocs.
  • Is the API surface minimized? To avoid breaking version upgrades, we'll need to maintain any APIs exposed, so we need to minimize and ensure that the API surface is correct.
  • Can the API evolve to support new requests? E.g., if we needed to support other CGroups resources or versions, can it be come in a clean way.

Given the above, it takes a fair bit of due diligence before we can approve exposing any further APIs.

@ovesh
Copy link

ovesh commented Jul 17, 2020

Moving CGroup parsing to a separate repo/module sounds like the best path forward IMO.

@zhijian-pro
Copy link

zhijian-pro commented Nov 1, 2022

I think it could be useful to provide an api to get the cpu num instead of setting it directly. It would be better to let the user set it manually.
We can release a V2 version to make these incompatible changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants