Changeset b4107c8 for benchmark/creation/pthreads.c
- Timestamp:
- Jan 7, 2020, 3:50:56 PM (5 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 580c11b
- Parents:
- 846c026
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
benchmark/creation/pthreads.c
r846c026 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.