mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Re: [pthreads-devel] NGPT 2.2.0 RELEASED: TOPS LINUXTHREADS AND NPTL IN SCALABILITY AND PERFORMANCE
@ 2003-01-11  1:28 Saurabh Desai
  0 siblings, 0 replies; only message in thread
From: Saurabh Desai @ 2003-01-11  1:28 UTC (permalink / raw)
  To: Bill Abt
  Cc: pthreads-announce, pthreads-core, pthreads-devel, pthreads-users,
	linux-kernel

[-- 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);
 }

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-01-11  1:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-01-11  1:28 [pthreads-devel] NGPT 2.2.0 RELEASED: TOPS LINUXTHREADS AND NPTL IN SCALABILITY AND PERFORMANCE Saurabh Desai

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®