Changes in benchmark/schedint/cfa2.cfa [2316525:6e540ea]
- File:
-
- 1 edited
-
benchmark/schedint/cfa2.cfa (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
benchmark/schedint/cfa2.cfa
r2316525 r6e540ea 4 4 #include <stdio.h> 5 5 6 #include " ../bench.h"6 #include "bench.h" 7 7 8 8 volatile int go = 0; 9 9 10 condition c; 10 monitor M {} m1, m2; 11 monitor M {}; 12 M m1, m2; 11 13 12 void __attribute__((noinline)) call( M & mutex p1, M & mutex p2 ) {13 signal( c);14 void __attribute__((noinline)) call( M & mutex a1, M & mutex a2 ) { 15 signal(c); 14 16 } 15 17 16 void __attribute__((noinline)) wait( M & mutex p1, M & mutex p2 ) {18 int __attribute__((noinline)) wait( M & mutex a1, M & mutex a2 ) { 17 19 go = 1; 18 for ( times ) { 19 wait( c ); 20 } 20 BENCH( 21 for ( i; times ) { 22 wait(c); 23 }, 24 result 25 ) 26 printf( "%g\n", result ); 21 27 go = 0; 28 return 0; 22 29 } 23 30 24 31 thread T {}; 32 void ^?{}( T & mutex this ) {} 25 33 void main( T & ) { 26 while ( go == 0 ) { yield(); } 27 BENCH( 28 while ( go == 1 ) { call( m1, m2 ); }, 29 result 30 ) 31 printf( "%g\n", result ); 34 while(go == 0) { yield(); } 35 while(go == 1) { call(m1, m2); } 36 32 37 } 33 38 … … 35 40 BENCH_START() 36 41 T t; 37 wait( m1, m2);42 return wait(m1, m2); 38 43 } 39 44
Note:
See TracChangeset
for help on using the changeset viewer.