All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andreas Ericsson <ae@op5.se>
To: Bert Wesarg <bert.wesarg@googlemail.com>
Cc: Git Mailing List <git@vger.kernel.org>,
	Junio C Hamano <gitster@pobox.com>, Nicolas Pitre <nico@cam.org>
Subject: Re: [PATCH] pack-objects: Add runtime detection of online CPU's
Date: Tue, 12 Feb 2008 13:21:47 +0100	[thread overview]
Message-ID: <47B18F5B.7020106@op5.se> (raw)
In-Reply-To: <36ca99e90802120318y5099b06cta3f8488dc758f6@mail.gmail.com>

Bert Wesarg wrote:
> Hi,
> 
> On Feb 12, 2008 9:20 AM, Andreas Ericsson <ae@op5.se> 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.
> 

Since you can do roughly the same by saying "git pack-objects --threads=2",
I'd rather not add a GNU/Linux specific hack for this.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

  reply	other threads:[~2008-02-12 12:22 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-12  8:20 [PATCH] pack-objects: Add runtime detection of online CPU's Andreas Ericsson
2008-02-12  8:27 ` Shawn O. Pearce
2008-02-12  8:49 ` Johannes Sixt
2008-02-12 11:18 ` Bert Wesarg
2008-02-12 12:21   ` Andreas Ericsson [this message]
2008-02-12 14:52 ` Michael Hendricks
2008-02-12 15:44 ` Brandon Casey
2008-02-23  2:11   ` Brandon Casey
2008-02-23  8:18     ` Andreas Ericsson
     [not found]   ` <1203732369-30314-1-git-send-email-casey@nrlssc.navy.mil>
2008-02-23  2:12     ` [PATCH] pack-objects: Print a message describing the number of threads for packing Brandon Casey
2008-02-26  7:49       ` Jeff King
2008-02-26  8:00         ` Junio C Hamano
2008-02-26  8:06           ` Jeff King
2008-02-26  9:19             ` Junio C Hamano
2008-02-26  9:33               ` Jeff King
2008-02-26  9:40           ` Andreas Ericsson
2008-02-26 15:53         ` Brandon Casey
2008-02-26 17:05           ` Nicolas Pitre
2008-02-26 21:25             ` Jeff King
2008-02-26 21:21           ` Jeff King
2008-02-26 22:50             ` Brandon Casey
2008-02-26 23:04               ` Jeff King

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47B18F5B.7020106@op5.se \
    --to=ae@op5.se \
    --cc=bert.wesarg@googlemail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=nico@cam.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.