source:
benchmark/schedext/cfa1.cfa
@
a254fa56
Last change on this file since a254fa56 was 26fd986, checked in by , 5 years ago | |
---|---|
|
|
File size: 527 bytes |
Rev | Line | |
---|---|---|
[73abe95] | 1 | #include <kernel.hfa> |
2 | #include <monitor.hfa> | |
3 | #include <thread.hfa> | |
[9f0b975] | 4 | #include <stdio.h> |
5 | ||
[2316525] | 6 | #include "../bench.h" |
[9f0b975] | 7 | |
[2316525] | 8 | monitor M {} m1; |
[9f0b975] | 9 | |
[2316525] | 10 | void __attribute__((noinline)) call( M & mutex p1 ) {} |
11 | void __attribute__((noinline)) wait( M & mutex p1 ) { | |
12 | for ( times ) { | |
13 | waitfor( call : p1 ); | |
[b4107c8] | 14 | } |
[9f0b975] | 15 | } |
16 | ||
17 | thread T {}; | |
[dc33b5b] | 18 | void main( T & ) { |
[b4107c8] | 19 | BENCH( |
[26fd986] | 20 | for ( times ) { call( m1 ); }, |
[b4107c8] | 21 | result |
22 | ) | |
23 | printf( "%g\n", result ); | |
[9f0b975] | 24 | } |
25 | ||
[b4107c8] | 26 | int main( int argc, char * argv[] ) { |
27 | BENCH_START() | |
[9f0b975] | 28 | T t; |
[2316525] | 29 | wait( m1 ); |
[dc33b5b] | 30 | } |
[b4107c8] | 31 | |
32 | // Local Variables: // | |
33 | // tab-width: 4 // | |
34 | // End: // |
Note: See TracBrowser
for help on using the repository browser.