LKML Archive on
help / color / mirror / Atom feed
From: Bill Davidsen <>
To: Brian McGrew <>
Subject: Re: Threading...
Date: Fri, 19 Jan 2007 16:26:38 -0500	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

Brian McGrew wrote:
> On 1/19/07 10:55 AM, "Arjan van de Ven" <> wrote:
>> On Fri, 2007-01-19 at 10:43 -0800, Brian McGrew wrote:
>>> I have a very interesting question about something that we're seeing
>>> happening with threading between Fedora Core 3 and Fedora Core 5.  Running
>>> on Dell PowerEdge 1800 Hardware with a Xeon processor with hyper-threading
>>> turned on.  Both systems are using a kernel (MVP al la special).
>>> We have a multithreaded application that starts two worker threads.  On
>>> Fedora Core 3 both of these we use getpid() to get the PID of the thread and
>>> then use set_afinity to assign each thread to it's own CPU.  Both threads
>>> run almost symmetrically even on their given CPU watching the system
>>> monitor.
>> this is odd; even in FC3 getpid() is supposed to return the process ID
>> not the thread ID
>>> What am I missing?  What do I need to do in FC5 or the kernel or the
>>> threading library to get my threads to run in symmetric parallel again???
>> you should fix the app to use something like pthread_self() instead...
>> (or the highly unportable gettid() but that would just be horrible)
> -----
> And on FC5 I am using pthread_self but my problem isn't simply with
> pthread_self, it's with the scheduling.  On FC3 both threads run
> simultaneously in almost symmetric parallel.  On FC5 one thread don't pick
> up and start until the previous one is done.  On FC3, using getpid for the
> thread I could use set_afinity to force each thread to its own processor and
> with FC5 I can't; so I've got one idle processor all the time.
This sounds so unlikely I hesitate to mention it, but you are not, by 
any chance, running pthreads on one and nptl on the other, are you?

bill davidsen <>
   CTO TMR Associates, Inc
   Doing interesting things with small computers since 1979

  parent reply	other threads:[~2007-01-19 21:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-19 18:43 Threading Brian McGrew
2007-01-19 18:55 ` Threading Arjan van de Ven
2007-01-19 19:01   ` Threading Brian McGrew
2007-01-19 19:23     ` Threading Arjan van de Ven
2007-01-19 21:26     ` Bill Davidsen [this message]
2007-01-20  1:18   ` Threading J.A. Magallón

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:

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

  git send-email \ \ \ \ \ \
    --subject='Re: Threading...' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).