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 <moshe@atlow.co.il>
    Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
    Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
    Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
    Reviewed-By: James M Snell <jasnell@gmail.com>
    Reviewed-By: Anna Henningsen <anna@addaleax.net>
    cjihrig committed Dec 21, 2022
    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 <moshe@atlow.co.il>
    Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
    Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
    Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
    Reviewed-By: James M Snell <jasnell@gmail.com>
    Reviewed-By: Anna Henningsen <anna@addaleax.net>
    cjihrig committed Dec 21, 2022
    Copy the full SHA
    dfbe36f View commit details
    Browse the repository at this point in the history