source: benchmark/mutexC/cfa1.cfa @ 9e63a2b

ADTarm-ehast-experimentalenumforall-pointer-decayjacob/cs343-translationjenkins-sandboxnew-astnew-ast-unique-exprpthread-emulationqualifiedEnum
Last change on this file since 9e63a2b was 51493a4, checked in by Peter A. Buhr <pabuhr@…>, 4 years ago

start directory for full-contention mutex tests

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