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