| 
            Last change
 on this file since e561551 was             26fd986, checked in by Peter A. Buhr <pabuhr@…>, 6 years ago           | 
        
        
          | 
             
update benchmarks for concurrency paper 
 
           | 
        
        
          
            
              - 
Property                 mode
 set to                 
100644
               
             
           | 
        
        
          | 
            File size:
            486 bytes
           | 
        
      
      
| Line |   | 
|---|
| 1 | #include <cstdio>
 | 
|---|
| 2 | 
 | 
|---|
| 3 | #include "bench.h"
 | 
|---|
| 4 | 
 | 
|---|
| 5 | _Monitor M {
 | 
|---|
| 6 | public:
 | 
|---|
| 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;
 | 
|---|
| 14 | 
 | 
|---|
| 15 | _Task T {
 | 
|---|
| 16 |         void main() {
 | 
|---|
| 17 |                 BENCH(
 | 
|---|
| 18 |                         for ( size_t i = 0; i < times; i++ ) {
 | 
|---|
| 19 |                                 m.call();
 | 
|---|
| 20 |                         },
 | 
|---|
| 21 |                         result
 | 
|---|
| 22 |                 )
 | 
|---|
| 23 |                 printf( "%g\n", result );
 | 
|---|
| 24 |         }
 | 
|---|
| 25 | };
 | 
|---|
| 26 | 
 | 
|---|
| 27 | int main( int argc, char * argv[] ) {
 | 
|---|
| 28 |         BENCH_START()
 | 
|---|
| 29 |         T t;
 | 
|---|
| 30 |         m.wait();
 | 
|---|
| 31 | }
 | 
|---|
| 32 | 
 | 
|---|
| 33 | // Local Variables: //
 | 
|---|
| 34 | // tab-width: 4 //
 | 
|---|
| 35 | // End: //
 | 
|---|
       
      
  Note:
 See   
TracBrowser
 for help on using the repository browser.