source: benchmark/schedext/cfa2.cfa @ 5936244

ADTarm-ehast-experimentalenumforall-pointer-decayjacob/cs343-translationnew-ast-unique-exprpthread-emulationqualifiedEnum
Last change on this file since 5936244 was 26fd986, checked in by Peter A. Buhr <pabuhr@…>, 5 years ago

update benchmarks for concurrency paper

  • Property mode set to 100644
File size: 575 bytes
Line 
1#include <kernel.hfa>
2#include <monitor.hfa>
3#include <thread.hfa>
4#include <stdio.h>
5
6#include "../bench.h"
7
8monitor M {} m1, m2;
9
10void __attribute__((noinline)) call( M & mutex p1, M & mutex p2 ) {}
11void __attribute__((noinline)) wait( M & mutex p1, M & mutex p2 ) {
12        for ( times ) {
13                waitfor( call : p1, p2 );
14        }
15}
16thread T {};
17void main( T & ) {
18        BENCH(
19                for ( times ) {
20                        call( m1, m2 );
21                },
22                result
23        )
24        printf( "%g\n", result );
25}
26
27int main( int argc, char * argv[] ) {
28        BENCH_START()
29        T t;
30        wait( m1, m2 );
31}
32
33// Local Variables: //
34// tab-width: 4 //
35// End: //
Note: See TracBrowser for help on using the repository browser.