ADT
arm-eh
ast-experimental
cleanup-dtors
enum
forall-pointer-decay
jacob/cs343-translation
jenkins-sandbox
new-ast
new-ast-unique-expr
pthread-emulation
qualifiedEnum
Last change
on this file since 9131e54 was bf71cfd, checked in by Thierry Delisle <tdelisle@…>, 7 years ago |
Moved up many directories in source
|
-
Property mode
set to
100644
|
File size:
532 bytes
|
Rev | Line | |
---|
[9f0b975] | 1 | #include <cstdio>
|
---|
| 2 |
|
---|
| 3 | #include "bench.h"
|
---|
| 4 |
|
---|
| 5 | int argc;
|
---|
| 6 | char** argv;
|
---|
| 7 | volatile int go = 0;
|
---|
| 8 |
|
---|
| 9 | _Monitor M {
|
---|
| 10 | public:
|
---|
| 11 | void __attribute__((noinline)) call() {}
|
---|
| 12 |
|
---|
| 13 | int __attribute__((noinline)) wait() {
|
---|
| 14 | go = 1;
|
---|
| 15 | BENCH(
|
---|
| 16 | for (size_t i = 0; i < n; i++) {
|
---|
| 17 | _Accept(call);
|
---|
| 18 | },
|
---|
| 19 | result
|
---|
| 20 | )
|
---|
| 21 |
|
---|
| 22 | printf("%llu\n", result);
|
---|
| 23 | go = 0;
|
---|
| 24 | return 0;
|
---|
| 25 | }
|
---|
| 26 | };
|
---|
| 27 |
|
---|
| 28 | M m;
|
---|
| 29 |
|
---|
| 30 | _Task T {
|
---|
| 31 | void main() {
|
---|
| 32 | while(go == 0) { yield(); }
|
---|
| 33 | while(go == 1) { m.call(); }
|
---|
| 34 |
|
---|
| 35 | }
|
---|
| 36 | };
|
---|
| 37 |
|
---|
| 38 | int main(int margc, char* margv[]) {
|
---|
| 39 | argc = margc;
|
---|
| 40 | argv = margv;
|
---|
| 41 | T t;
|
---|
| 42 | return m.wait();
|
---|
| 43 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.