DragonFly users List (threaded) for 2008-03
DragonFly BSD
DragonFly users List (threaded) for 2008-03
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

_SC_NPROCESSORS_ONLN on Dragonfly


From: Klaus Heinz <k.heinz@xxxxxxxxxxxxxxxxx>
Date: Thu, 20 Mar 2008 00:07:00 +0100

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






[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]