ADTarm-ehast-experimentalenumforall-pointer-decayjacob/cs343-translationnew-astnew-ast-unique-exprpthread-emulationqualifiedEnum
Last change
on this file since 8f4f3e0 was
26fd986,
checked in by Peter A. Buhr <pabuhr@…>, 5 years ago
|
update benchmarks for concurrency paper
|
-
Property mode set to
100644
|
File size:
663 bytes
|
Line | |
---|
1 | #include <kernel.hfa> |
---|
2 | #include <monitor.hfa> |
---|
3 | #include <thread.hfa> |
---|
4 | #include <stdio.h> |
---|
5 | |
---|
6 | #include "../bench.h" |
---|
7 | |
---|
8 | monitor M {} m1, m2, m3, m4; |
---|
9 | |
---|
10 | void __attribute__((noinline)) call( M & mutex p1, M & mutex p2, M & mutex p3, M & mutex p4 ) {} |
---|
11 | void __attribute__((noinline)) wait( M & mutex p1, M & mutex p2, M & mutex p3, M & mutex p4 ) { |
---|
12 | for ( times ) { |
---|
13 | waitfor( call : p1, p2, p3, p4 ); |
---|
14 | } |
---|
15 | } |
---|
16 | thread T {}; |
---|
17 | void main( T & ) { |
---|
18 | BENCH( |
---|
19 | for ( times ) { |
---|
20 | call( m1, m2, m3, m4 ); |
---|
21 | }, |
---|
22 | result |
---|
23 | ) |
---|
24 | printf( "%g\n", result ); |
---|
25 | } |
---|
26 | |
---|
27 | int main( int argc, char * argv[] ) { |
---|
28 | BENCH_START() |
---|
29 | T t; |
---|
30 | wait( m1, m2, m3, m4 ); |
---|
31 | } |
---|
32 | |
---|
33 | // Local Variables: // |
---|
34 | // tab-width: 4 // |
---|
35 | // End: // |
---|
Note: See
TracBrowser
for help on using the repository browser.