Changeset bdfc032 for benchmark/schedext/upp.cc
- Timestamp:
- Feb 4, 2020, 11:35:26 AM (4 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- eef8dfb
- Parents:
- aefb247 (diff), 4f7b418 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
benchmark/schedext/upp.cc
raefb247 rbdfc032 3 3 #include "bench.h" 4 4 5 int argc;6 char** argv;7 volatile int go = 0;8 9 5 _Monitor M { 10 6 public: 11 7 void __attribute__((noinline)) call() {} 8 void __attribute__((noinline)) wait() { 9 for ( size_t i = 0; i < times; i++ ) { 10 _Accept(call); 11 } 12 } 13 } m; 12 14 13 int __attribute__((noinline)) wait(){14 go = 1;15 _Task T { 16 void main() { 15 17 BENCH( 16 for ( size_t i = 0; i < n; i++) {17 _Accept(call);18 for ( size_t i = 0; i < times; i++ ) { 19 m.call(); 18 20 }, 19 21 result 20 22 ) 21 22 printf("%g\n", result); 23 go = 0; 24 return 0; 23 printf( "%g\n", result ); 25 24 } 26 25 }; 27 26 28 M m; 27 int main( int argc, char * argv[] ) { 28 BENCH_START() 29 T t; 30 m.wait(); 31 } 29 32 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 } 33 // Local Variables: // 34 // tab-width: 4 // 35 // End: //
Note: See TracChangeset
for help on using the changeset viewer.