source: benchmark/schedext/upp.cc@ 5ee7d36

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 5ee7d36 was 2316525, checked in by Peter A. Buhr <pabuhr@…>, 6 years ago

update benchmarks for concurrency paper

  • Property mode set to 100644
File size: 554 bytes
RevLine 
[9f0b975]1#include <cstdio>
2
3#include "bench.h"
4
5volatile int go = 0;
6
7_Monitor M {
8public:
9 void __attribute__((noinline)) call() {}
10
11 int __attribute__((noinline)) wait() {
12 go = 1;
[2316525]13 for ( size_t i = 0; i < times; i++ ) {
[b4107c8]14 _Accept(call);
15 }
[9f0b975]16 go = 0;
17 return 0;
18 }
[2316525]19} m;
[9f0b975]20
21_Task T {
22 void main() {
[2316525]23 while ( go == 0 ) { yield(); }
[b4107c8]24 BENCH(
[2316525]25 while ( go == 1 ) { m.call(); },
[b4107c8]26 result
27 )
28 printf( "%g\n", result );
[9f0b975]29 }
30};
31
[b4107c8]32int main( int argc, char * argv[] ) {
33 BENCH_START()
[9f0b975]34 T t;
35 return m.wait();
[dc33b5b]36}
[b4107c8]37
38// Local Variables: //
39// tab-width: 4 //
40// End: //
Note: See TracBrowser for help on using the repository browser.