Changes in benchmark/creation/pthreads.c [dc33b5b:b4107c8]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
benchmark/creation/pthreads.c
rdc33b5b rb4107c8 4 4 #include "bench.h" 5 5 6 static void * foo(void *arg) {6 static void * foo(void *arg) { 7 7 return arg; 8 8 } 9 9 10 int main(int argc, char* argv[]) { 10 int main( int argc, char * argv[] ) { 11 BENCH_START() 11 12 BENCH( 12 for (size_t i = 0; i < n; i++) {13 for (size_t i = 0; i < times; i++) { 13 14 pthread_t thread; 14 15 if (pthread_create(&thread, NULL, foo, NULL) < 0) { … … 16 17 return 1; 17 18 } 18 19 19 if (pthread_join( thread, NULL) < 0) { 20 20 perror( "failure" ); … … 24 24 result 25 25 ) 26 printf( "%g\n", result ); 27 } 26 28 27 printf("%g\n", result); 28 } 29 // Local Variables: // 30 // tab-width: 4 // 31 // End: //
Note: See TracChangeset
for help on using the changeset viewer.