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

os: add availableParallelism() #45895

Merged
merged 2 commits into from
Dec 21, 2022
Merged

os: add availableParallelism() #45895

merged 2 commits into from
Dec 21, 2022

Commits on Dec 21, 2022

  1. os: add availableParallelism()

    This commit exposes uv_available_parallelism() as an alternative
    to cpus().length. uv_available_parallelism() is inspired by
    Rust's available_parallelism().
    
    PR-URL: nodejs#45895
    Reviewed-By: Moshe Atlow <[email protected]>
    Reviewed-By: Ruben Bridgewater <[email protected]>
    Reviewed-By: Luigi Pinca <[email protected]>
    Reviewed-By: Ben Noordhuis <[email protected]>
    Reviewed-By: James M Snell <[email protected]>
    Reviewed-By: Anna Henningsen <[email protected]>
    cjihrig committed Dec 21, 2022
    Configuration menu
    Copy the full SHA
    288c421 View commit details
    Browse the repository at this point in the history
  2. doc: add parallelism note to os.cpus()

    With the introduction of os.availableParallelism(), users should
    no longer rely on os.cpus().length to determine the amount of
    available parallelism. This commit adds a note to the os.cpus()
    docs.
    
    PR-URL: nodejs#45895
    Reviewed-By: Moshe Atlow <[email protected]>
    Reviewed-By: Ruben Bridgewater <[email protected]>
    Reviewed-By: Luigi Pinca <[email protected]>
    Reviewed-By: Ben Noordhuis <[email protected]>
    Reviewed-By: James M Snell <[email protected]>
    Reviewed-By: Anna Henningsen <[email protected]>
    cjihrig committed Dec 21, 2022
    Configuration menu
    Copy the full SHA
    dfbe36f View commit details
    Browse the repository at this point in the history