Changes in benchmark/schedint/cfa1.cfa [dc33b5b:26fd986]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
benchmark/schedint/cfa1.cfa
rdc33b5b r26fd986 4 4 #include <stdio.h> 5 5 6 #include " bench.h"6 #include "../bench.h" 7 7 8 int argc;9 char** argv;10 8 volatile int go = 0; 11 9 12 10 condition c; 13 monitor M {}; 14 M m1; 11 monitor M {} m1; 15 12 16 void __attribute__((noinline)) call( M & mutex a1 ) {17 signal( c);13 void __attribute__((noinline)) call( M & mutex p1 ) { 14 signal( c ); 18 15 } 19 20 int __attribute__((noinline)) wait( M & mutex a1 ) { 16 void __attribute__((noinline)) wait( M & mutex p1 ) { 21 17 go = 1; 22 BENCH( 23 for ( i; n ) { 24 wait(c); 25 }, 26 result 27 ) 28 29 printf("%g\n", result); 30 go = 0; 31 return 0; 18 for ( times ) { 19 wait( c ); 20 } 32 21 } 33 22 34 23 thread T {}; 35 void ^?{}( T & mutex ) {}36 24 void main( T & ) { 37 while(go == 0) { yield(); } 38 while(go == 1) { call(m1); } 39 25 while ( go == 0 ) { yield(); } // waiter must start first 26 BENCH( 27 for ( times ) { call( m1 ); }, 28 result 29 ) 30 printf( "%g\n", result ); 40 31 } 41 32 42 int main(__attribute__((unused)) int argc, __attribute__((unused)) char* argv[]) { 33 int main( int argc, char * argv[] ) { 34 BENCH_START() 43 35 T t; 44 return wait(m1);36 wait( m1 ); 45 37 } 38 39 // Local Variables: // 40 // tab-width: 4 // 41 // End: //
Note: See TracChangeset
for help on using the changeset viewer.