Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • benchmark/schedint/upp.cc

    r26fd986 rdc33b5b  
    33#include "bench.h"
    44
     5int argc;
     6char** argv;
    57volatile int go = 0;
    68
     
    1113                cond.signal();
    1214        }
    13         void __attribute__((noinline)) wait() {
     15
     16        int __attribute__((noinline)) wait() {
    1417                go = 1;
    15                 for ( size_t i = 0; i < times; i++ ) {
    16                         cond.wait();
    17                 }
     18                BENCH(
     19                        for (size_t i = 0; i < n; i++) {
     20                                cond.wait();
     21                        },
     22                        result
     23                )
     24
     25                printf("%g\n", result);
     26                go = 0;
     27                return 0;
    1828        }
    19 } m;
     29};
     30
     31M m;
    2032
    2133_Task T {
    2234        void main() {
    23                 while ( go == 0 ) { yield(); } // waiter must start first
    24                 BENCH(
    25                         for ( size_t i = 0; i < times; i++ ) {
    26                                 m.call();
    27                         },
    28                         result
    29                 )
    30                 printf( "%g\n", result );
     35                while(go == 0) { yield(); }
     36                while(go == 1) { m.call(); }
     37
    3138        }
    3239};
    3340
    34 int main( int argc, char * argv[] ) {
    35         BENCH_START()
     41int main(__attribute__((unused)) int argc, __attribute__((unused)) char* argv[]) {
    3642        T t;
    37         m.wait();
     43        return m.wait();
    3844}
    39 
    40 // Local Variables: //
    41 // tab-width: 4 //
    42 // End: //
Note: See TracChangeset for help on using the changeset viewer.