source: benchmark/schedext/cfa1.cfa @ b202dc2

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

update benchmarks for concurrency paper

  • Property mode set to 100644
File size: 527 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;
9
10void __attribute__((noinline)) call( M & mutex p1 ) {}
11void __attribute__((noinline)) wait( M & mutex p1 ) {
12        for ( times ) {
13                waitfor( call : p1 );
14        }
15}
16
17thread T {};
18void main( T & ) {
19        BENCH(
20                for ( times ) { call( m1 ); },
21                result
22        )
23        printf( "%g\n", result );
24}
25
26int main( int argc, char * argv[] ) {
27        BENCH_START()
28        T t;
29        wait( m1 );
30}
31
32// Local Variables: //
33// tab-width: 4 //
34// End: //
Note: See TracBrowser for help on using the repository browser.