Changeset b4107c8 for benchmark/schedint/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/schedint/pthreads.c
r846c026 rb4107c8 4 4 #include "bench.h" 5 5 6 int argc;7 char** argv;8 6 volatile int go = 0; 9 7 … … 21 19 go = 1; 22 20 BENCH( 23 for (size_t i = 0; i < n; i++) {21 for (size_t i = 0; i < times; i++) { 24 22 pthread_cond_wait(&c, &m); 25 23 }, 26 24 result 27 25 ) 28 29 printf("%g\n", result); 26 printf( "%g\n", result ); 30 27 go = 0; 31 28 pthread_mutex_unlock(&m); … … 39 36 } 40 37 41 int main(__attribute__((unused)) int argc, __attribute__((unused)) char* argv[]) { 38 int main( int argc, char * argv[] ) { 39 BENCH_START() 42 40 pthread_t thread; 43 41 if (pthread_create(&thread, NULL, thread_main, NULL) < 0) { … … 50 48 return 1; 51 49 } 52 return 0;53 50 } 51 52 // Local Variables: // 53 // tab-width: 4 // 54 // End: //
Note: See TracChangeset
for help on using the changeset viewer.