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

Re: Bug#510624: ITP: pigz -- Parallel Implementation of GZip

On Sat, Jan 03, 2009 at 09:57:33PM +0100, Eduard Bloch wrote:

> PS: I plan to hack it a little bit and use syssconf function on Debian
> systems to determine the real number of CPU cores (#x) since pigz's
> default value is 8 which is much more than home systems have nowadays,
> and the performance isn't getting (much) better with a constant number
> of idle threads, they just consume more memory.

Although sysconf() can tell you the total number of cores and the number of
cores that are online in your system, it does not tell you how many cores are
available for your program. It's better to use sched_getaffinity() to get the
set of CPU (cores) available to your program. And if you know better than the
OS, use sched_setaffinity() to bind each thread to it's own core.

Met vriendelijke groet / with kind regards,
      Guus Sliepen <guus@debian.org>

Attachment: signature.asc
Description: Digital signature

Reply to: