Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • benchmark/schedint/cfa4.cfa

    r6e540ea r2316525  
    77
    88volatile int go = 0;
     9condition c;
     10monitor M {} m1, m2, m3, m4;
    911
    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);
     12void __attribute__((noinline)) call( M & mutex p1, M & mutex p2, M & mutex p3, M & mutex p4 ) {
     13        signal( c );
    1614}
    1715
    18 int  __attribute__((noinline)) wait( M & mutex a1, M & mutex a2, M & mutex a3, M & mutex a4 ) {
     16void __attribute__((noinline)) wait( M & mutex p1, M & mutex p2, M & mutex p3, M & mutex p4 ) {
    1917        go = 1;
     18        for ( times ) {
     19                wait( c );
     20        }
     21        go = 0;
     22}
     23
     24thread T {};
     25void main( T & ) {
     26        while ( go == 0 ) { yield(); }
    2027        BENCH(
    21                 for ( i; times ) {
    22                         wait(c);
    23                 },
     28                while ( go == 1 ) { call( m1, m2, m3, m4 ); },
    2429                result
    2530        )
    2631        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 
    3732}
    3833
     
    4035        BENCH_START()
    4136        T t;
    42         return wait(m1, m2, m3, m4);
     37        wait( m1, m2, m3, m4 );
    4338}
    4439
Note: See TracChangeset for help on using the changeset viewer.