-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
unix,win: add uv_available_parallelism() #3499
Conversation
@tkf replaces JuliaLang/julia#42340 |
Nice, I just needed this the other day and used the naive CPU count! |
Replacement for the usage pattern where people use uv_cpu_info() as an imperfect heuristic for determining the amount of parallelism that is available to their programs. Fixes libuv#3493.
#else /* __linux__ */ | ||
long rc; | ||
|
||
rc = sysconf(_SC_NPROCESSORS_ONLN); |
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.
This broke zOS (in jenkins CI):
/u/iojs/build/workspace/libuv-test-commit-zos-cmake/BUILDTYPE/Release/nodes/zos-s390x/src/unix/core.c:1677:16: error: use of undeclared identifier '_SC_NPROCESSORS_ONLN'
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.
Fix(ish) in #3513.
Notable changes: - Build regression fixes for various platform updates (libuv/libuv#3428, libuv/libuv#3419, libuv/libuv#3423, libuv/libuv#3413, libuv/libuv#3431) - Support for GNU/Hurd (libuv/libuv#3450) - Release tool improvements (libuv/libuv-release-tool#13) - Better performing rw locks on Win32 (libuv/libuv#3383) - Support for posix_spawn API (libuv/libuv#3257) - Fixed regression on OpenBSD (libuv/libuv#3506) - Added uv_available_parallelism() (libuv/libuv#3499) - Other bug fixes (libuv/libuv#3524, libuv/libuv#3521) Fixes: nodejs#42290
Notable changes: - Build regression fixes for various platform updates (libuv/libuv#3428, libuv/libuv#3419, libuv/libuv#3423, libuv/libuv#3413, libuv/libuv#3431) - Support for GNU/Hurd (libuv/libuv#3450) - Release tool improvements (libuv/libuv-release-tool#13) - Better performing rw locks on Win32 (libuv/libuv#3383) - Support for posix_spawn API (libuv/libuv#3257) - Fixed regression on OpenBSD (libuv/libuv#3506) - Added uv_available_parallelism() (libuv/libuv#3499) - Other bug fixes (libuv/libuv#3524, libuv/libuv#3521) Fixes: nodejs#42290
Notable changes: - Build regression fixes for various platform updates (libuv/libuv#3428, libuv/libuv#3419, libuv/libuv#3423, libuv/libuv#3413, libuv/libuv#3431) - Support for GNU/Hurd (libuv/libuv#3450) - Release tool improvements (libuv/libuv-release-tool#13) - Better performing rw locks on Win32 (libuv/libuv#3383) - Support for posix_spawn API (libuv/libuv#3257) - Fixed regression on OpenBSD (libuv/libuv#3506) - Added uv_available_parallelism() (libuv/libuv#3499) - Other bug fixes (libuv/libuv#3524, libuv/libuv#3521) Fixes: nodejs#42290
Notable changes: - Build regression fixes for various platform updates (libuv/libuv#3428, libuv/libuv#3419, libuv/libuv#3423, libuv/libuv#3413, libuv/libuv#3431) - Support for GNU/Hurd (libuv/libuv#3450) - Release tool improvements (libuv/libuv-release-tool#13) - Better performing rw locks on Win32 (libuv/libuv#3383) - Support for posix_spawn API (libuv/libuv#3257) - Fixed regression on OpenBSD (libuv/libuv#3506) - Added uv_available_parallelism() (libuv/libuv#3499) - Other bug fixes (libuv/libuv#3524, libuv/libuv#3521) Fixes: nodejs#42290
Replacement for the usage pattern where people use uv_cpu_info() as an imperfect heuristic for determining the amount of parallelism that is available to their programs. Fixes libuv#3493.
Notable changes: - Build regression fixes for various platform updates (libuv/libuv#3428, libuv/libuv#3419, libuv/libuv#3423, libuv/libuv#3413, libuv/libuv#3431) - Support for GNU/Hurd (libuv/libuv#3450) - Release tool improvements (libuv/libuv-release-tool#13) - Better performing rw locks on Win32 (libuv/libuv#3383) - Support for posix_spawn API (libuv/libuv#3257) - Fix regression on OpenBSD (libuv/libuv#3506) - Add uv_available_parallelism() (libuv/libuv#3499) - Don't use thread-unsafe strtok() (libuv/libuv#3524) - Fix hang after NOTE_EXIT (libuv/libuv#3521) - Better align order-of-events behavior between platforms (libuv/libuv#3598) - Fix fs event not fired if the watched file is moved/removed/recreated (libuv/libuv#3540) - Fix pipe resource leak if closed during connect (and other bugs) (libuv/libuv#3611) - Don't error when killing a zombie process (libuv/libuv#3625) - Avoid posix_spawnp() cwd bug (libuv/libuv#3597) - Skip EVFILT_PROC events when invalidating events for an fd (libuv/libuv#3629) Fixes: nodejs#42290
Notable changes: - Build regression fixes for various platform updates (libuv/libuv#3428, libuv/libuv#3419, libuv/libuv#3423, libuv/libuv#3413, libuv/libuv#3431) - Support for GNU/Hurd (libuv/libuv#3450) - Release tool improvements (libuv/libuv-release-tool#13) - Better performing rw locks on Win32 (libuv/libuv#3383) - Support for posix_spawn API (libuv/libuv#3257) - Fix regression on OpenBSD (libuv/libuv#3506) - Add uv_available_parallelism() (libuv/libuv#3499) - Don't use thread-unsafe strtok() (libuv/libuv#3524) - Fix hang after NOTE_EXIT (libuv/libuv#3521) - Better align order-of-events behavior between platforms (libuv/libuv#3598) - Fix fs event not fired if the watched file is moved/removed/recreated (libuv/libuv#3540) - Fix pipe resource leak if closed during connect (and other bugs) (libuv/libuv#3611) - Don't error when killing a zombie process (libuv/libuv#3625) - Avoid posix_spawnp() cwd bug (libuv/libuv#3597) - Skip EVFILT_PROC events when invalidating events for an fd (libuv/libuv#3629) Fixes: nodejs#42290
Notable changes: - Build regression fixes for various platform updates (libuv/libuv#3428, libuv/libuv#3419, libuv/libuv#3423, libuv/libuv#3413, libuv/libuv#3431) - Support for GNU/Hurd (libuv/libuv#3450) - Release tool improvements (libuv/libuv-release-tool#13) - Better performing rw locks on Win32 (libuv/libuv#3383) - Support for posix_spawn API (libuv/libuv#3257) - Fix regression on OpenBSD (libuv/libuv#3506) - Add uv_available_parallelism() (libuv/libuv#3499) - Don't use thread-unsafe strtok() (libuv/libuv#3524) - Fix hang after NOTE_EXIT (libuv/libuv#3521) - Better align order-of-events behavior between platforms (libuv/libuv#3598) - Fix fs event not fired if the watched file is moved/removed/recreated (libuv/libuv#3540) - Fix pipe resource leak if closed during connect (and other bugs) (libuv/libuv#3611) - Don't error when killing a zombie process (libuv/libuv#3625) - Avoid posix_spawnp() cwd bug (libuv/libuv#3597) - Skip EVFILT_PROC events when invalidating events for an fd (libuv/libuv#3629) Fixes: nodejs#42290
Notable changes: - Build regression fixes for various platform updates (libuv/libuv#3428, libuv/libuv#3419, libuv/libuv#3423, libuv/libuv#3413, libuv/libuv#3431) - Support for GNU/Hurd (libuv/libuv#3450) - Release tool improvements (libuv/libuv-release-tool#13) - Better performing rw locks on Win32 (libuv/libuv#3383) - Support for posix_spawn API (libuv/libuv#3257) - Fix regression on OpenBSD (libuv/libuv#3506) - Add uv_available_parallelism() (libuv/libuv#3499) - Don't use thread-unsafe strtok() (libuv/libuv#3524) - Fix hang after NOTE_EXIT (libuv/libuv#3521) - Better align order-of-events behavior between platforms (libuv/libuv#3598) - Fix fs event not fired if the watched file is moved/removed/recreated (libuv/libuv#3540) - Fix pipe resource leak if closed during connect (and other bugs) (libuv/libuv#3611) - Don't error when killing a zombie process (libuv/libuv#3625) - Avoid posix_spawnp() cwd bug (libuv/libuv#3597) - Skip EVFILT_PROC events when invalidating events for an fd (libuv/libuv#3629) Fixes: nodejs#42290
Notable changes: - Build regression fixes for various platform updates (libuv/libuv#3428, libuv/libuv#3419, libuv/libuv#3423, libuv/libuv#3413, libuv/libuv#3431) - Support for GNU/Hurd (libuv/libuv#3450) - Release tool improvements (libuv/libuv-release-tool#13) - Better performing rw locks on Win32 (libuv/libuv#3383) - Support for posix_spawn API (libuv/libuv#3257) - Fix regression on OpenBSD (libuv/libuv#3506) - Add uv_available_parallelism() (libuv/libuv#3499) - Don't use thread-unsafe strtok() (libuv/libuv#3524) - Fix hang after NOTE_EXIT (libuv/libuv#3521) - Better align order-of-events behavior between platforms (libuv/libuv#3598) - Fix fs event not fired if the watched file is moved/removed/recreated (libuv/libuv#3540) - Fix pipe resource leak if closed during connect (and other bugs) (libuv/libuv#3611) - Don't error when killing a zombie process (libuv/libuv#3625) - Avoid posix_spawnp() cwd bug (libuv/libuv#3597) - Skip EVFILT_PROC events when invalidating events for an fd (libuv/libuv#3629) Fixes: nodejs#42290
Notable changes: - Build regression fixes for various platform updates (libuv/libuv#3428, libuv/libuv#3419, libuv/libuv#3423, libuv/libuv#3413, libuv/libuv#3431) - Support for GNU/Hurd (libuv/libuv#3450) - Release tool improvements (libuv/libuv-release-tool#13) - Better performing rw locks on Win32 (libuv/libuv#3383) - Support for posix_spawn API (libuv/libuv#3257) - Fix regression on OpenBSD (libuv/libuv#3506) - Add uv_available_parallelism() (libuv/libuv#3499) - Don't use thread-unsafe strtok() (libuv/libuv#3524) - Fix hang after NOTE_EXIT (libuv/libuv#3521) - Better align order-of-events behavior between platforms (libuv/libuv#3598) - Fix fs event not fired if the watched file is moved/removed/recreated (libuv/libuv#3540) - Fix pipe resource leak if closed during connect (and other bugs) (libuv/libuv#3611) - Don't error when killing a zombie process (libuv/libuv#3625) - Avoid posix_spawnp() cwd bug (libuv/libuv#3597) - Skip EVFILT_PROC events when invalidating events for an fd (libuv/libuv#3629) Fixes: nodejs#42290
Notable changes: - Build regression fixes for various platform updates (libuv/libuv#3428, libuv/libuv#3419, libuv/libuv#3423, libuv/libuv#3413, libuv/libuv#3431) - Support for GNU/Hurd (libuv/libuv#3450) - Release tool improvements (libuv/libuv-release-tool#13) - Better performing rw locks on Win32 (libuv/libuv#3383) - Support for posix_spawn API (libuv/libuv#3257) - Fix regression on OpenBSD (libuv/libuv#3506) - Add uv_available_parallelism() (libuv/libuv#3499) - Don't use thread-unsafe strtok() (libuv/libuv#3524) - Fix hang after NOTE_EXIT (libuv/libuv#3521) - Better align order-of-events behavior between platforms (libuv/libuv#3598) - Fix fs event not fired if the watched file is moved/removed/recreated (libuv/libuv#3540) - Fix pipe resource leak if closed during connect (and other bugs) (libuv/libuv#3611) - Don't error when killing a zombie process (libuv/libuv#3625) - Avoid posix_spawnp() cwd bug (libuv/libuv#3597) - Skip EVFILT_PROC events when invalidating events for an fd (libuv/libuv#3629) Fixes: nodejs#42290
Notable changes: - Build regression fixes for various platform updates (libuv/libuv#3428, libuv/libuv#3419, libuv/libuv#3423, libuv/libuv#3413, libuv/libuv#3431) - Support for GNU/Hurd (libuv/libuv#3450) - Release tool improvements (libuv/libuv-release-tool#13) - Better performing rw locks on Win32 (libuv/libuv#3383) - Support for posix_spawn API (libuv/libuv#3257) - Fix regression on OpenBSD (libuv/libuv#3506) - Add uv_available_parallelism() (libuv/libuv#3499) - Don't use thread-unsafe strtok() (libuv/libuv#3524) - Fix hang after NOTE_EXIT (libuv/libuv#3521) - Better align order-of-events behavior between platforms (libuv/libuv#3598) - Fix fs event not fired if the watched file is moved/removed/recreated (libuv/libuv#3540) - Fix pipe resource leak if closed during connect (and other bugs) (libuv/libuv#3611) - Don't error when killing a zombie process (libuv/libuv#3625) - Avoid posix_spawnp() cwd bug (libuv/libuv#3597) - Skip EVFILT_PROC events when invalidating events for an fd (libuv/libuv#3629) Fixes: nodejs#42290
Notable changes: - Build regression fixes for various platform updates (libuv/libuv#3428, libuv/libuv#3419, libuv/libuv#3423, libuv/libuv#3413, libuv/libuv#3431) - Support for GNU/Hurd (libuv/libuv#3450) - Release tool improvements (libuv/libuv-release-tool#13) - Better performing rw locks on Win32 (libuv/libuv#3383) - Support for posix_spawn API (libuv/libuv#3257) - Fix regression on OpenBSD (libuv/libuv#3506) - Add uv_available_parallelism() (libuv/libuv#3499) - Don't use thread-unsafe strtok() (libuv/libuv#3524) - Fix hang after NOTE_EXIT (libuv/libuv#3521) - Better align order-of-events behavior between platforms (libuv/libuv#3598) - Fix fs event not fired if the watched file is moved/removed/recreated (libuv/libuv#3540) - Fix pipe resource leak if closed during connect (and other bugs) (libuv/libuv#3611) - Don't error when killing a zombie process (libuv/libuv#3625) - Avoid posix_spawnp() cwd bug (libuv/libuv#3597) - Skip EVFILT_PROC events when invalidating events for an fd (libuv/libuv#3629) Fixes: nodejs#42290
Notable changes: - Build regression fixes for various platform updates (libuv/libuv#3428, libuv/libuv#3419, libuv/libuv#3423, libuv/libuv#3413, libuv/libuv#3431) - Support for GNU/Hurd (libuv/libuv#3450) - Release tool improvements (libuv/libuv-release-tool#13) - Better performing rw locks on Win32 (libuv/libuv#3383) - Support for posix_spawn API (libuv/libuv#3257) - Fix regression on OpenBSD (libuv/libuv#3506) - Add uv_available_parallelism() (libuv/libuv#3499) - Don't use thread-unsafe strtok() (libuv/libuv#3524) - Fix hang after NOTE_EXIT (libuv/libuv#3521) - Better align order-of-events behavior between platforms (libuv/libuv#3598) - Fix fs event not fired if the watched file is moved/removed/recreated (libuv/libuv#3540) - Fix pipe resource leak if closed during connect (and other bugs) (libuv/libuv#3611) - Don't error when killing a zombie process (libuv/libuv#3625) - Avoid posix_spawnp() cwd bug (libuv/libuv#3597) - Skip EVFILT_PROC events when invalidating events for an fd (libuv/libuv#3629) Fixes: #42290 PR-URL: #42340 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Notable changes: - Build regression fixes for various platform updates (libuv/libuv#3428, libuv/libuv#3419, libuv/libuv#3423, libuv/libuv#3413, libuv/libuv#3431) - Support for GNU/Hurd (libuv/libuv#3450) - Release tool improvements (libuv/libuv-release-tool#13) - Better performing rw locks on Win32 (libuv/libuv#3383) - Support for posix_spawn API (libuv/libuv#3257) - Fix regression on OpenBSD (libuv/libuv#3506) - Add uv_available_parallelism() (libuv/libuv#3499) - Don't use thread-unsafe strtok() (libuv/libuv#3524) - Fix hang after NOTE_EXIT (libuv/libuv#3521) - Better align order-of-events behavior between platforms (libuv/libuv#3598) - Fix fs event not fired if the watched file is moved/removed/recreated (libuv/libuv#3540) - Fix pipe resource leak if closed during connect (and other bugs) (libuv/libuv#3611) - Don't error when killing a zombie process (libuv/libuv#3625) - Avoid posix_spawnp() cwd bug (libuv/libuv#3597) - Skip EVFILT_PROC events when invalidating events for an fd (libuv/libuv#3629) Fixes: nodejs#42290 PR-URL: nodejs#42340 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Notable changes: - Build regression fixes for various platform updates (libuv/libuv#3428, libuv/libuv#3419, libuv/libuv#3423, libuv/libuv#3413, libuv/libuv#3431) - Support for GNU/Hurd (libuv/libuv#3450) - Release tool improvements (libuv/libuv-release-tool#13) - Better performing rw locks on Win32 (libuv/libuv#3383) - Support for posix_spawn API (libuv/libuv#3257) - Fix regression on OpenBSD (libuv/libuv#3506) - Add uv_available_parallelism() (libuv/libuv#3499) - Don't use thread-unsafe strtok() (libuv/libuv#3524) - Fix hang after NOTE_EXIT (libuv/libuv#3521) - Better align order-of-events behavior between platforms (libuv/libuv#3598) - Fix fs event not fired if the watched file is moved/removed/recreated (libuv/libuv#3540) - Fix pipe resource leak if closed during connect (and other bugs) (libuv/libuv#3611) - Don't error when killing a zombie process (libuv/libuv#3625) - Avoid posix_spawnp() cwd bug (libuv/libuv#3597) - Skip EVFILT_PROC events when invalidating events for an fd (libuv/libuv#3629) Fixes: #42290 PR-URL: #42340 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Notable changes: - Build regression fixes for various platform updates (libuv/libuv#3428, libuv/libuv#3419, libuv/libuv#3423, libuv/libuv#3413, libuv/libuv#3431) - Support for GNU/Hurd (libuv/libuv#3450) - Release tool improvements (libuv/libuv-release-tool#13) - Better performing rw locks on Win32 (libuv/libuv#3383) - Support for posix_spawn API (libuv/libuv#3257) - Fix regression on OpenBSD (libuv/libuv#3506) - Add uv_available_parallelism() (libuv/libuv#3499) - Don't use thread-unsafe strtok() (libuv/libuv#3524) - Fix hang after NOTE_EXIT (libuv/libuv#3521) - Better align order-of-events behavior between platforms (libuv/libuv#3598) - Fix fs event not fired if the watched file is moved/removed/recreated (libuv/libuv#3540) - Fix pipe resource leak if closed during connect (and other bugs) (libuv/libuv#3611) - Don't error when killing a zombie process (libuv/libuv#3625) - Avoid posix_spawnp() cwd bug (libuv/libuv#3597) - Skip EVFILT_PROC events when invalidating events for an fd (libuv/libuv#3629) Fixes: #42290 PR-URL: #42340 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Notable changes: - Build regression fixes for various platform updates (libuv/libuv#3428, libuv/libuv#3419, libuv/libuv#3423, libuv/libuv#3413, libuv/libuv#3431) - Support for GNU/Hurd (libuv/libuv#3450) - Release tool improvements (libuv/libuv-release-tool#13) - Better performing rw locks on Win32 (libuv/libuv#3383) - Support for posix_spawn API (libuv/libuv#3257) - Fix regression on OpenBSD (libuv/libuv#3506) - Add uv_available_parallelism() (libuv/libuv#3499) - Don't use thread-unsafe strtok() (libuv/libuv#3524) - Fix hang after NOTE_EXIT (libuv/libuv#3521) - Better align order-of-events behavior between platforms (libuv/libuv#3598) - Fix fs event not fired if the watched file is moved/removed/recreated (libuv/libuv#3540) - Fix pipe resource leak if closed during connect (and other bugs) (libuv/libuv#3611) - Don't error when killing a zombie process (libuv/libuv#3625) - Avoid posix_spawnp() cwd bug (libuv/libuv#3597) - Skip EVFILT_PROC events when invalidating events for an fd (libuv/libuv#3629) Fixes: #42290 PR-URL: #42340 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Notable changes: - Build regression fixes for various platform updates (libuv/libuv#3428, libuv/libuv#3419, libuv/libuv#3423, libuv/libuv#3413, libuv/libuv#3431) - Support for GNU/Hurd (libuv/libuv#3450) - Release tool improvements (libuv/libuv-release-tool#13) - Better performing rw locks on Win32 (libuv/libuv#3383) - Support for posix_spawn API (libuv/libuv#3257) - Fix regression on OpenBSD (libuv/libuv#3506) - Add uv_available_parallelism() (libuv/libuv#3499) - Don't use thread-unsafe strtok() (libuv/libuv#3524) - Fix hang after NOTE_EXIT (libuv/libuv#3521) - Better align order-of-events behavior between platforms (libuv/libuv#3598) - Fix fs event not fired if the watched file is moved/removed/recreated (libuv/libuv#3540) - Fix pipe resource leak if closed during connect (and other bugs) (libuv/libuv#3611) - Don't error when killing a zombie process (libuv/libuv#3625) - Avoid posix_spawnp() cwd bug (libuv/libuv#3597) - Skip EVFILT_PROC events when invalidating events for an fd (libuv/libuv#3629) Fixes: #42290 PR-URL: #42340 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
This change is causing the following build error for nodejs 18.14.1 on Android:
|
@nappy No, it's because of how node compiles libuv. It looks like it's missing a |
@bnoordhuis Thanks for the heads up. Adding the flag indeed helped. I opened a node issue on that. |
I know you figured it out already but for posterity: yeah, that file went away in the latest release. |
Replacement for the usage pattern where people use uv_cpu_info() as an
imperfect heuristic for determining the amount of parallelism that is
available to their programs.
Fixes #3493.
You can test the linux behavior with: