linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Mike Black" <mblack@csi-inc.com>
To: "linux-kernel" <linux-kernel@vger.kernel.org>
Subject: Pthread performance
Date: Fri, 11 Jul 2003 07:18:34 -0400	[thread overview]
Message-ID: <022401c3479e$2b1cd2e0$c8de11cc@black> (raw)

I found a benchmark program for threads and found a major difference between a single CPU and dual CPU system.
Here's the code:
http://www-124.ibm.com/pipermail/pthreads-users/2002-April/000176.html
Is this showing context switches going between CPUs??
Wouldn't one expect the dual CPU to run twice as fast instead of ten times slower?
As you can see from the timing user time increases by a factor of 4 and system time by a factor of 10.
I seem to remember something about gettimeofday() possibly being a problem but couldn't find a reference to it.
Anybody have an explanation/fix for this?
I'm running 2.4.21 with glibc-2.3.2 

Single CPU (Athlon 2400):
Thread     Count Start Time   End Time  Reverses
------   ------- ----------   --------  --------
0         100000    0.00014    0.55257     99998
1         100000    0.00018    0.44839     99997
2         100000    0.00018    0.57385    100000
3         100000    0.00026    0.37884     99999
4         100000    0.00026    0.50911    100000
5         100000    0.00028    0.49115     99998
6         100000    0.00035    0.53783    100000
7         100000    0.00036    0.60039    100000
8         100000    0.00038    0.60346     81847
9         100000    0.45934    0.59906     99998
Total elapsed time is    0.60348 seconds
0.080u 0.530s 0:00.60 101.6%    0+0k 0+0io 136pf+0w
Dual CPU (Athlon 2000MP):
Thread     Count Start Time   End Time  Reverses
------   ------- ----------   --------  --------
0         100000    0.00024    2.35316    100000
1         100000    0.00031    2.65760    100000
2         100000    0.00036    2.61471    100000
3         100000    0.00048    2.59529    100000
4         100000    0.00055    2.65601    100000
5         100000    0.00060    2.70938     98040
6         100000    0.00065    2.68379    100000
7         100000    0.00075    2.71154     95341
8         100000    0.00082    2.69375    100000
9         100000    0.00089    2.71491     78796
Total elapsed time is    2.71494 seconds
0.380u 5.040s 0:02.71 200.0%    0+0k 0+0io 133pf+0w


Michael D. Black mblack@csi-inc.com
http://www.csi-inc.com/
http://www.csi-inc.com/~mike
Melbourne FL
Michael D. Black mblack@csi-inc.com
http://www.csi-inc.com/
http://www.csi-inc.com/~mike
321-676-2923, x203
Melbourne FL

             reply	other threads:[~2003-07-11 11:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-11 11:18 Mike Black [this message]
2003-07-13 20:11 ` Pthread performance David Schwartz

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='022401c3479e$2b1cd2e0$c8de11cc@black' \
    --to=mblack@csi-inc.com \
    --cc=linux-kernel@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).