ADT
arm-eh
ast-experimental
enum
forall-pointer-decay
jacob/cs343-translation
jenkins-sandbox
new-ast
new-ast-unique-expr
pthread-emulation
qualifiedEnum
Last change
on this file since 3e93c00 was dc33b5b, checked in by Peter A. Buhr <pabuhr@…>, 6 years ago |
update benchmarks and add benchmarks for qthreads
|
-
Property mode
set to
100644
|
File size:
415 bytes
|
Rev | Line | |
---|
[5b11c25] | 1 | #include <kernel.hfa>
|
---|
| 2 | #include <thread.hfa>
|
---|
| 3 |
|
---|
| 4 | #include "bench.h"
|
---|
| 5 |
|
---|
| 6 | void noOp(void) {}
|
---|
| 7 |
|
---|
| 8 | coroutine GreatSuspender {};
|
---|
| 9 |
|
---|
| 10 | void ?{}( GreatSuspender & this ) {
|
---|
| 11 | prime(this);
|
---|
| 12 | }
|
---|
| 13 |
|
---|
| 14 | void main( __attribute__((unused)) GreatSuspender & this ) {
|
---|
| 15 | while( true ) {
|
---|
| 16 | suspend_then(noOp);
|
---|
| 17 | }
|
---|
| 18 | }
|
---|
| 19 |
|
---|
| 20 | int main(int argc, char* argv[]) {
|
---|
| 21 | GreatSuspender s;
|
---|
| 22 |
|
---|
| 23 | BENCH(
|
---|
[dc33b5b] | 24 | for ( i; n ) {
|
---|
[5b11c25] | 25 | resume( s );
|
---|
| 26 | },
|
---|
| 27 | result
|
---|
| 28 | )
|
---|
| 29 |
|
---|
[dc33b5b] | 30 | printf("%g\n", result);
|
---|
| 31 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.