mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Con Kolivas <kernel@kolivas.org>
To: Marcel Zalmanovici <MARCEL@il.ibm.com>
Cc: linux-kernel@vger.kernel.org, Muli Ben-Yehuda <mulix@mulix.org>
Subject: Re: Inconsistent timing results of multithreaded program on an SMP machine.
Date: Sun, 20 Nov 2005 21:50:49 +1100	[thread overview]
Message-ID: <200511202150.49702.kernel@kolivas.org> (raw)
In-Reply-To: <OFADF30D19.6C548DAE-ONC22570BF.003B5172-C22570BF.003B9597@il.ibm.com>

On Sun, 20 Nov 2005 21:50, Marcel Zalmanovici wrote:
> On Sun, 20 Nov 2005 21:35, Muli Ben-Yehuda wrote:
> > On Sun, Nov 20, 2005 at 09:28:13PM +1100, Con Kolivas wrote:
> > > Ok I've had a look at the actual program now ;) Are you timing the time
> > > it takes to completion of everything?
> > >
> > > This part of your program:
> > >          for (i= 0; i<8; i++)
> > >                      pthread_join(tid[i], NULL);
> > >
> > > Cares about the order the threads finish. Do you think this might be
> > > affecting your results?
> >
> > I don't see why it should matter. Depending on the order the threads
> > finish, we will always wait in pthread_join until the last one
> > finishes, and then do between 0 and 7 more pthread_joins that should
> > return immediately (since the last one has already finished).
>
> If it was instant it shouldn't matter. I'm aware of that in theory, but
> there
> have certainly been reports of pthread_join taking quite a while happening
> in
> a sort of lazy/sloppy way. I don't know why this is the case but I wondered
>
> if it was showing up here.
>
> I've looked through the detailed run results and found this:
>
> Thread DS 0, TID = 7646
> Thread DS 0, TID = 7645
> Thread DS 1, TID = 7648
> Thread DS 1, TID = 7650
> Thread DS 2, TID = 7651
> Thread DS 2, TID = 7652
> Thread DS 3, TID = 7653
> Thread DS 3, TID = 7654
> Main exit ...
> real 23.25
>
> As you can see except the first 2 threads all finished in order they were
> created. With the average being at about 16.5 this is a high result and
> thread order was almost ideal.

Ok, but how long does pthread_join actually take to complete?

Cheers,
Con

P.S. Lotus notes is terrible for a mailer isn't it?

  reply	other threads:[~2005-11-20 10:51 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-20  9:27 Marcel Zalmanovici
2005-11-20  9:54 ` Con Kolivas
2005-11-20 10:18   ` Marcel Zalmanovici
2005-11-20 10:28     ` Con Kolivas
2005-11-20 10:35       ` Muli Ben-Yehuda
2005-11-20 10:39         ` Con Kolivas
2005-11-20 10:43           ` Muli Ben-Yehuda
2005-11-20 10:50           ` Marcel Zalmanovici
2005-11-20 10:50             ` Con Kolivas [this message]
2005-11-20 10:43       ` Marcel Zalmanovici
2005-11-20 14:02 ` Paul Jackson
2005-11-24  9:50   ` Marcel Zalmanovici
     [not found] <OF507D27BA.6B51F19A-ONC22570C3.002E62D2-C22570C3.002F0C99@il.ibm.com>
2005-11-24  9:40 ` Con Kolivas
2005-11-24 10:00   ` Marcel Zalmanovici
2005-11-24 12:43     ` Paul Jackson
2005-12-04 15:26       ` Marcel Zalmanovici
2005-12-04 19:54         ` Paul Jackson

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=200511202150.49702.kernel@kolivas.org \
    --to=kernel@kolivas.org \
    --cc=MARCEL@il.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mulix@mulix.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome