Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • benchmark/schedint/cfa1.cfa

    r26fd986 rdc33b5b  
    44#include <stdio.h>
    55
    6 #include "../bench.h"
     6#include "bench.h"
    77
     8int argc;
     9char** argv;
    810volatile int go = 0;
    911
    1012condition c;
    11 monitor M {} m1;
     13monitor M {};
     14M m1;
    1215
    13 void __attribute__((noinline)) call( M & mutex p1 ) {
    14         signal( c );
     16void __attribute__((noinline)) call( M & mutex a1 ) {
     17        signal(c);
    1518}
    16 void __attribute__((noinline)) wait( M & mutex p1 ) {
     19
     20int  __attribute__((noinline)) wait( M & mutex a1 ) {
    1721        go = 1;
    18         for ( times ) {
    19                 wait( c );
    20         }
     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;
    2132}
    2233
    2334thread T {};
     35void ^?{}( T & mutex ) {}
    2436void main( T & ) {
    25         while ( go == 0 ) { yield(); } // waiter must start first
    26         BENCH(
    27                 for ( times ) { call( m1 ); },
    28                 result
    29         )
    30         printf( "%g\n", result );
     37        while(go == 0) { yield(); }
     38        while(go == 1) { call(m1); }
     39
    3140}
    3241
    33 int main( int argc, char * argv[] ) {
    34         BENCH_START()
     42int main(__attribute__((unused)) int argc, __attribute__((unused)) char* argv[]) {
    3543        T t;
    36         wait( m1 );
     44        return wait(m1);
    3745}
    38 
    39 // Local Variables: //
    40 // tab-width: 4 //
    41 // End: //
Note: See TracChangeset for help on using the changeset viewer.