Changeset b7d6a36 for benchmark/schedext/cfa1.cfa
- Timestamp:
- Feb 20, 2020, 4:15:51 PM (6 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 6a490b2
- Parents:
- dca5802 (diff), 2cbfe92 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
benchmark/schedext/cfa1.cfa
rdca5802 rb7d6a36 4 4 #include <stdio.h> 5 5 6 #include " bench.h"6 #include "../bench.h" 7 7 8 int argc; 9 char** argv; 10 volatile int go = 0; 8 monitor M {} m1; 11 9 12 monitor M {}; 13 M m1; 14 15 void __attribute__((noinline)) call( M & mutex a1 ) {} 16 17 int __attribute__((noinline)) wait( M & mutex a1 ) { 18 go = 1; 19 BENCH( 20 for ( i; n ) { 21 waitfor(call, a1); 22 }, 23 result 24 ) 25 26 printf("%g\n", result); 27 go = 0; 28 return 0; 10 void __attribute__((noinline)) call( M & mutex p1 ) {} 11 void __attribute__((noinline)) wait( M & mutex p1 ) { 12 for ( times ) { 13 waitfor( call : p1 ); 14 } 29 15 } 30 16 31 17 thread T {}; 32 void ^?{}( T & mutex this ) {}33 18 void main( T & ) { 34 while(go == 0) { yield(); } 35 while(go == 1) { call(m1); } 36 19 BENCH( 20 for ( times ) { call( m1 ); }, 21 result 22 ) 23 printf( "%g\n", result ); 37 24 } 38 25 39 int main(__attribute__((unused)) int argc, __attribute__((unused)) char* argv[]) { 26 int main( int argc, char * argv[] ) { 27 BENCH_START() 40 28 T t; 41 return wait(m1);29 wait( m1 ); 42 30 } 31 32 // Local Variables: // 33 // tab-width: 4 // 34 // End: //
Note:
See TracChangeset
for help on using the changeset viewer.