mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Saurabh Desai <sdesai@us.ibm.com>
To: Bill Abt <babt@us.ibm.com>
Cc: pthreads-announce@www-124.southbury.usf.ibm.com,
	pthreads-core@www-124.southbury.usf.ibm.com,
	pthreads-devel@www-124.southbury.usf.ibm.com,
	pthreads-users@www-124.southbury.usf.ibm.com,
	linux-kernel@vger.kernel.org
Subject: Re: [pthreads-devel] NGPT 2.2.0 RELEASED: TOPS LINUXTHREADS AND NPTL IN SCALABILITY AND PERFORMANCE
Date: Fri, 10 Jan 2003 18:28:11 -0700	[thread overview]
Message-ID: <OFD021A392.2FDB9E5D-ON87256CAB.00072F44@us.ibm.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 277 bytes --]






The benchmark program (pingpong) developed by Sun Microsystem can be found
at
 http://wwws.sun.com/software/whitepapers/solaris9/multithread.pdf

This patch is needed to compile and run under Linux.

(See attached file: pingpong.c.diff)

Thanks,
- - - - -
Saurabh Desai



[-- Attachment #2: pingpong.c.diff --]
[-- Type: application/octet-stream, Size: 1716 bytes --]

--- pingpong.c.orig	Fri Jan 10 19:03:45 2003
+++ pingpong.c	Fri Jan 10 19:04:58 2003
@@ -7,7 +7,7 @@
  * * cc -mt -xarch=v9 -xO4 pp.c -o pp64 -lpthread -lrt
  * */
 #include <pthread.h>
-#include <thread.h>
+/* #include <thread.h> */
 #include <stdlib.h>
 #include <strings.h>
 #include <stdio.h>
@@ -69,7 +69,7 @@
 main(int argc, char *argv[])
 {
 	int c;
-	hrtime_t t0;
+	struct timeval t0, t1;
 	int ntables = 1;
 	int target = 1000000;
 	int sleepms = 0;
@@ -159,27 +159,31 @@
 	barrier_init(&begin_barrier, (2 * ntables) + 1);
 	barrier_init(&end_barrier, (2 * ntables) + 1);
 	/* should not be needed - sigh! */
-	if (concurrency > 0) {
-		(void) thr_setconcurrency(concurrency);
-	}
+	//if (concurrency > 0) {
+		//(void) thr_setconcurrency(concurrency);
+	//}
 	/* initialise all games */
-	t0 = gethrtime();
+	gettimeofday(&t0, NULL);
 	setup_tables(ntables, target, sleepms);
 	
 	/* wait for all players to be ready */
 	barrier_wait(&setup_barrier);
 	if (verbose) {
-		(void) printf("%d threads initialised in %lldms\n",
-			      ntables * 2, (gethrtime() - t0)/1000000LL);
+		gettimeofday(&t1, NULL);
+		timersub(&t1, &t0, &t1);
+		(void) printf("%d threads initialised in %ds.%dms\n",
+			      ntables * 2, t1.tv_sec, t1.tv_usec);
 	}
 	/* start all games */
-	t0 = gethrtime();
+	gettimeofday(&t0, NULL);
 	barrier_wait(&begin_barrier);
 	/* wait for all games to complete */
 	barrier_wait(&end_barrier);
 	if (verbose) {
-		(void) printf("%d games completed in %lldms\n",
-			      ntables, (gethrtime() - t0)/1000000LL);
+		gettimeofday(&t1, NULL);
+		timersub(&t1, &t0, &t1);
+		(void) printf("%d games completed in %ds.%dms\n",
+			      ntables,  t1.tv_sec, t1.tv_usec);
 	}
 	return (0);
 }

                 reply	other threads:[~2003-01-11  1:19 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=OFD021A392.2FDB9E5D-ON87256CAB.00072F44@us.ibm.com \
    --to=sdesai@us.ibm.com \
    --cc=babt@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pthreads-announce@www-124.southbury.usf.ibm.com \
    --cc=pthreads-core@www-124.southbury.usf.ibm.com \
    --cc=pthreads-devel@www-124.southbury.usf.ibm.com \
    --cc=pthreads-users@www-124.southbury.usf.ibm.com \
    /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

all inboxes | Powered by JetHome®