-
Notifications
You must be signed in to change notification settings - Fork 13
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
Add ThreadCount type #31
Add ThreadCount type #31
Conversation
7668ea8
to
0da66e4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We definitely do not want to add OSHI as a dependency here. Can we do this in pure Java, such as by reading /proc/cpuinfo?
@electrum can I make it optional with the default being a /proc/cpuinfo based? |
Optional dependencies are a pain. How do you test that the fallback works? You need a different test suite that doesn’t have the optional dependency on the classpath. The question is if we can get this from Java without needing a native dependency. If no, then we can evaluate options. If yes, then why make it optional? |
@electrum Sure. I'll implement it without deps. Thanks for guidance! |
48da75b
to
14c5638
Compare
@electrum ptal |
8e9df4f
to
a7ff0ff
Compare
Tested in docker on arm64:
|
a7ff0ff
to
9b40e65
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good
293491a
to
b68eea2
Compare
@electrum all of your comments are addressed now |
b68eea2
to
0645461
Compare
I've fixed the compilation error on JDK 11 (the last working airlift version is 219, 220 was switched to JDK 17) |
@sopel39 ptal |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - but I @sopel39 PTAL too.
7d0e6d4
to
4c572f7
Compare
4c572f7
to
0ac0845
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's drop the @PowerOfTwo
validator. If we're going to do the clamping in the caller, then it doesn't make sense to have this validator. Also, it wouldn't work with ThreadCount
since that isn't an integer.
relative to the number of physical CPUs. On ARM64 and non-linux systems this is resolved using java's Runtime. For AMD64 on Linux /proc/cpuinfo is parsed to detect number of physical CPUs. Both implementations are container-aware and will return the number of requested CPUs if specified for the container.
0ac0845
to
5442f37
Compare
@electrum PTAL. Rebased and addressed all comments. I've added |
No description provided.