Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • benchmark/schedint/cfa1.cfa

    rdc33b5b r26fd986  
    44#include <stdio.h>
    55
    6 #include "bench.h"
     6#include "../bench.h"
    77
    8 int argc;
    9 char** argv;
    108volatile int go = 0;
    119
    1210condition c;
    13 monitor M {};
    14 M m1;
     11monitor M {} m1;
    1512
    16 void __attribute__((noinline)) call( M & mutex a1 ) {
    17         signal(c);
     13void __attribute__((noinline)) call( M & mutex p1 ) {
     14        signal( c );
    1815}
    19 
    20 int  __attribute__((noinline)) wait( M & mutex a1 ) {
     16void __attribute__((noinline)) wait( M & mutex p1 ) {
    2117        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        }
    3221}
    3322
    3423thread T {};
    35 void ^?{}( T & mutex ) {}
    3624void 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 );
    4031}
    4132
    42 int main(__attribute__((unused)) int argc, __attribute__((unused)) char* argv[]) {
     33int main( int argc, char * argv[] ) {
     34        BENCH_START()
    4335        T t;
    44         return wait(m1);
     36        wait( m1 );
    4537}
     38
     39// Local Variables: //
     40// tab-width: 4 //
     41// End: //
Note: See TracChangeset for help on using the changeset viewer.