_SC_NPROCESSORS_ONLN on Dragonfly
Klaus Heinz
k.heinz at maeracht.kh-22.de
Wed Mar 19 16:13:21 PDT 2008
Hi,
I am feeding back patches to the authors of audio/gtkpod and found this
one (in patch-bj) concerning Dragonfly:
{ /* set to maximum available number of processors */
+#if defined(_SC_NPROCESSORS_ONLN) && !defined(__DragonFly__)
conv->max_threads_num = sysconf (_SC_NPROCESSORS_ONLN);
+#else
+ conv->max_threads_num = 1;
+#endif
/* paranoia mode on */
if (conv->max_threads_num <= 0)
{
A little research showed that _SC_NPROCESSORS_ONLN was added to
Dragonfly in February. If this is really working the above could be
simplified to
+#if defined(_SC_NPROCESSORS_ONLN)
conv->max_threads_num = sysconf (_SC_NPROCESSORS_ONLN);
+#else
...
Is there a reason to set the number of threads to 1 on Dragonfly systems
where _SC_NPROCESSORS_ONLN is defined?
ciao
Klaus
More information about the Users
mailing list