pulseaudio/src
John Paul Adrian Glaubitz 1df21e6ab6 core-util: Use _SC_NPROCESSORS_ONLN instead of _SC_NPROCESSORS_CONF
pa_ncpu() is supposed to report the number of processors available on
the system. For that, it currently calls sysconf(_SC_NPROCESSORS_CONF).
However, since the operating system can disable individual processors,
we should call sysconf(_SC_NPROCESSORS_ONLN) to determine the number
of processors currently available [1]. Consequently, the once-test will
fail since pthread_setaffinity_np() is called with CPUs that are
currently not available.

It might also be advisable to change the code in the future to use CPU
sets on Linux as even the suggested change is not 100% safe but at least
it improves over the existing code. If PulseAudio was to be run in a CPU
set [2], the number of processors available to PulseAudio could be even
less than the number of CPUs currently online (_SC_NPROCESSORS_CONF).

[1] https://www.gnu.org/software/libc/manual/html_node/Processor-Resources.html
[2] http://man7.org/linux/man-pages/man7/cpuset.7.html

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=96809
Signed-off-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
2016-08-15 17:23:36 +03:00
..
daemon launch: explain why .service depends on .socket 2016-07-20 23:39:59 +03:00
modules pipe-sink: align buffer 2016-08-13 00:34:18 +03:00
pulse json: Drop refcounting of json objects 2016-06-22 21:04:47 +05:30
pulsecore core-util: Use _SC_NPROCESSORS_ONLN instead of _SC_NPROCESSORS_CONF 2016-08-15 17:23:36 +03:00
tests tests: Include signal.h in core-util-test.c 2016-08-10 16:52:50 +03:00
utils qpaeq: Don't set font-size on widgets 2016-06-22 12:55:55 +05:30
.gitignore pulse: Add a JSON-parsing library 2016-06-22 21:04:47 +05:30
depmod.py update FSF addresses to FSF web page 2015-01-14 22:20:40 +02:00
Makefile.am format: Drop dependency on json-c 2016-06-22 21:04:47 +05:30
map-file volume: Add LFE balance API 2015-10-30 09:13:10 +02:00