Re: [PATCH] pack-objects: Add runtime detection of online CPU's

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

 



Hi,

On Feb 12, 2008 9:20 AM, Andreas Ericsson <ae@xxxxxx> wrote:
> +#ifdef THREADED_DELTA_SEARCH
> +# ifdef _SC_NPROCESSORS_ONLN
> +       long ncpus;
> +
> +       if ((ncpus = (long)sysconf(_SC_NPROCESSORS_ONLN)) > 0)
> +               return (int)ncpus;
> +# else
I can't find the right pointer, but for linux it would be more usable
to use sched_getaffinity(). Than you can do thinks like this:

$ taskset 0x3 git gc ...

and you will get 2 cpus, even 4 are online.

Bert
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux