-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
os.cpus() docs misleading #16279
Comments
The word "threads" seems a bit confusing here. AFAICT |
Logical core seems like a more accurate description 👍 |
@lukechilds A PR would be very welcomed. Check out our contributing guide if you want to submit one. :) |
Original text implied it returns physical cpu cores. This is misleading as `os.cpus().length` is often used to get the CPU core count in Node.js. In reality that will return the thread count which may not be what the user intended. Fixes: nodejs#16279
Original text implied it returns physical cpu cores. This is misleading as `os.cpus().length` is often used to get the CPU core count in Node.js. In reality that will return the thread count which may not be what the user intended. PR-URL: nodejs/node#16282 Fixes: nodejs/node#16279 Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Bryan English <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
Original text implied it returns physical cpu cores. This is misleading as `os.cpus().length` is often used to get the CPU core count in Node.js. In reality that will return the thread count which may not be what the user intended. PR-URL: #16282 Fixes: #16279 Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Bryan English <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
Original text implied it returns physical cpu cores. This is misleading as `os.cpus().length` is often used to get the CPU core count in Node.js. In reality that will return the thread count which may not be what the user intended. PR-URL: #16282 Fixes: #16279 Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Bryan English <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
Original text implied it returns physical cpu cores. This is misleading as `os.cpus().length` is often used to get the CPU core count in Node.js. In reality that will return the thread count which may not be what the user intended. PR-URL: #16282 Fixes: #16279 Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Bryan English <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
Original text implied it returns physical cpu cores. This is misleading as `os.cpus().length` is often used to get the CPU core count in Node.js. In reality that will return the thread count which may not be what the user intended. PR-URL: #16282 Fixes: #16279 Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Bryan English <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
The docs for
os.cpus()
state:It would be more accurate to use the word "threads" rather than "CPU/core". Not sure if this behaviour is intentional or due to how the OS reports cores. Either way, a note in the docs would be helpful to clarify this. Do you want a PR?
Example:
The text was updated successfully, but these errors were encountered: