Changeset 2316525 for benchmark/schedint
- Timestamp:
- Jan 19, 2020, 4:16:27 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:
- f090750
- Parents:
- 9e63a2b
- Location:
- benchmark/schedint
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
benchmark/schedint/cfa1.cfa
r9e63a2b r2316525 4 4 #include <stdio.h> 5 5 6 #include " bench.h"6 #include "../bench.h" 7 7 8 8 volatile int go = 0; 9 condition c; 10 monitor M {} m1; 9 11 10 condition c; 11 monitor M {}; 12 M m1; 13 14 void __attribute__((noinline)) call( M & mutex a1 ) { 15 signal(c); 12 void __attribute__((noinline)) call( M & mutex p1 ) { 13 signal( c ); 16 14 } 17 15 18 int __attribute__((noinline)) wait( M & mutex a1 ) {16 void __attribute__((noinline)) wait( M & mutex p1 ) { 19 17 go = 1; 18 for ( times ) { 19 wait( c ); 20 } 21 go = 0; 22 } 23 24 thread T {}; 25 void main( T & ) { 26 while ( go == 0 ) { yield(); } 20 27 BENCH( 21 for ( i; times ) { 22 wait(c); 23 }, 28 while ( go == 1 ) { call( m1 ); }, 24 29 result 25 30 ) 26 31 printf( "%g\n", result ); 27 go = 0;28 return 0;29 }30 31 thread T {};32 void ^?{}( T & mutex ) {}33 void main( T & ) {34 while(go == 0) { yield(); }35 while(go == 1) { call(m1); }36 37 32 } 38 33 … … 40 35 BENCH_START() 41 36 T t; 42 return wait(m1);37 wait( m1 ); 43 38 } 44 39 -
benchmark/schedint/cfa2.cfa
r9e63a2b r2316525 4 4 #include <stdio.h> 5 5 6 #include " bench.h"6 #include "../bench.h" 7 7 8 8 volatile int go = 0; 9 condition c; 10 monitor M {} m1, m2; 9 11 10 condition c; 11 monitor M {}; 12 M m1, m2; 13 14 void __attribute__((noinline)) call( M & mutex a1, M & mutex a2 ) { 15 signal(c); 12 void __attribute__((noinline)) call( M & mutex p1, M & mutex p2 ) { 13 signal( c ); 16 14 } 17 15 18 int __attribute__((noinline)) wait( M & mutex a1, M & mutex a2 ) {16 void __attribute__((noinline)) wait( M & mutex p1, M & mutex p2 ) { 19 17 go = 1; 18 for ( times ) { 19 wait( c ); 20 } 21 go = 0; 22 } 23 24 thread T {}; 25 void main( T & ) { 26 while ( go == 0 ) { yield(); } 20 27 BENCH( 21 for ( i; times ) { 22 wait(c); 23 }, 28 while ( go == 1 ) { call( m1, m2 ); }, 24 29 result 25 30 ) 26 31 printf( "%g\n", result ); 27 go = 0;28 return 0;29 }30 31 thread T {};32 void ^?{}( T & mutex this ) {}33 void main( T & ) {34 while(go == 0) { yield(); }35 while(go == 1) { call(m1, m2); }36 37 32 } 38 33 … … 40 35 BENCH_START() 41 36 T t; 42 return wait(m1, m2);37 wait( m1, m2 ); 43 38 } 44 39 -
benchmark/schedint/cfa4.cfa
r9e63a2b r2316525 7 7 8 8 volatile int go = 0; 9 condition c; 10 monitor M {} m1, m2, m3, m4; 9 11 10 condition c; 11 monitor M {}; 12 M m1, m2, m3, m4; 13 14 void __attribute__((noinline)) call( M & mutex a1, M & mutex a2, M & mutex a3, M & mutex a4 ) { 15 signal(c); 12 void __attribute__((noinline)) call( M & mutex p1, M & mutex p2, M & mutex p3, M & mutex p4 ) { 13 signal( c ); 16 14 } 17 15 18 int __attribute__((noinline)) wait( M & mutex a1, M & mutex a2, M & mutex a3, M & mutex a4 ) {16 void __attribute__((noinline)) wait( M & mutex p1, M & mutex p2, M & mutex p3, M & mutex p4 ) { 19 17 go = 1; 18 for ( times ) { 19 wait( c ); 20 } 21 go = 0; 22 } 23 24 thread T {}; 25 void main( T & ) { 26 while ( go == 0 ) { yield(); } 20 27 BENCH( 21 for ( i; times ) { 22 wait(c); 23 }, 28 while ( go == 1 ) { call( m1, m2, m3, m4 ); }, 24 29 result 25 30 ) 26 31 printf( "%g\n", result ); 27 go = 0;28 return 0;29 }30 31 thread T {};32 void ^?{}( T & mutex this ) {}33 void main( T & ) {34 while(go == 0) { yield(); }35 while(go == 1) { call(m1, m2, m3, m4); }36 37 32 } 38 33 … … 40 35 BENCH_START() 41 36 T t; 42 return wait(m1, m2, m3, m4);37 wait( m1, m2, m3, m4 ); 43 38 } 44 39
Note: See TracChangeset
for help on using the changeset viewer.