-
Notifications
You must be signed in to change notification settings - Fork 83
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
Rename hw_concurrency
to available_parallelism
.
#419
Rename hw_concurrency
to available_parallelism
.
#419
Conversation
Following the general computer-science meanings of the terms "concurrency" and "parallelism", rename `thread.hw_concurrency` to `thread.available_parallelism`, because it's about the number of threads that can execute in parallel. This differs from the existing JS API of [`navigator.hardwareConcurrency`], so add a note mentioning the correspondence. [`navigator.hardwareConcurrency`]: https://developer.mozilla.org/en-US/docs/Web/API/Navigator/hardwareConcurrency
As the person who added
|
Agreed! It's good to see the prior art for |
(I forgot above, but cc @abrown) |
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.
I think this is the right change to make, especially if other languages are doing this. The sole reason I named this hw_concurrency
initially was to line up with the JS version of this. Given that this functionality has moved to the component model, just documenting that relationship and using the new name seems fine.
Following the general computer-science meanings of the terms "concurrency" and "parallelism", rename
thread.hw_concurrency
tothread.available_parallelism
, because it's about the number of threads that can execute in parallel.This differs from the existing JS API of
navigator.hardwareConcurrency
, so add a note mentioning the correspondence.