Changes in src/benchmark/csv-data.c [bd37119:7286a40]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/benchmark/csv-data.c
rbd37119 r7286a40 8 8 coroutine GreatSuspender {}; 9 9 10 void ?{}( GreatSuspender &this ) {10 void ?{}( GreatSuspender * this ) { 11 11 prime(this); 12 12 } 13 13 14 void main( GreatSuspender &this )14 void main( GreatSuspender * this ) 15 15 { 16 16 while( true ) { … … 21 21 void resumer( GreatSuspender * this, const unsigned int NoOfTimes ) { 22 22 for ( volatile unsigned int i = 0; i < NoOfTimes; i += 1 ) { 23 resume( *this );23 resume( this ); 24 24 } 25 25 } … … 58 58 // single monitor entry 59 59 monitor mon_t {}; 60 void dummy( mon_t &mutex m ) {}60 void dummy( mon_t * mutex m ) {} 61 61 62 62 long long int measure_1_monitor_entry() { … … 67 67 StartTime = Time(); 68 68 for ( volatile unsigned int i = 0; i < NoOfTimes; i += 1 ) { 69 dummy( mon );69 dummy( &mon ); 70 70 } 71 71 EndTime = Time(); … … 76 76 //----------------------------------------------------------------------------- 77 77 // multi monitor entry 78 void dummy( mon_t & mutex m1, mon_t &mutex m2 ) {}78 void dummy( mon_t * mutex m1, mon_t * mutex m2 ) {} 79 79 80 80 long long int measure_2_monitor_entry() { … … 85 85 StartTime = Time(); 86 86 for ( volatile unsigned int i = 0; i < NoOfTimes; i += 1 ) { 87 dummy( mon1,mon2 );87 dummy( &mon1, &mon2 ); 88 88 } 89 89 EndTime = Time(); … … 102 102 thread thrd1b {}; 103 103 104 void ?{}( thrd1a &this, long long int * out ) {105 this .out = out;106 } 107 108 void side1A( mon_t &mutex a, long long int * out ) {104 void ?{}( thrd1a * this, long long int * out ) { 105 this->out = out; 106 } 107 108 void side1A( mon_t * mutex a, long long int * out ) { 109 109 long long int StartTime, EndTime; 110 110 … … 120 120 } 121 121 122 void side1B( mon_t &mutex a ) {122 void side1B( mon_t * mutex a ) { 123 123 for( int i = 0;; i++ ) { 124 124 signal(&cond1b); … … 128 128 } 129 129 130 void main( thrd1a & this ) { side1A( mon1, this.out ); }131 void main( thrd1b & this ) { side1B(mon1 ); }130 void main( thrd1a * this ) { side1A( &mon1, this->out ); } 131 void main( thrd1b * this ) { side1B( &mon1 ); } 132 132 133 133 long long int measure_1_sched_int() { … … 150 150 thread thrd2b {}; 151 151 152 void ?{}( thrd2a &this, long long int * out ) {153 this .out = out;154 } 155 156 void side2A( mon_t & mutex a, mon_t &mutex b, long long int * out ) {152 void ?{}( thrd2a * this, long long int * out ) { 153 this->out = out; 154 } 155 156 void side2A( mon_t * mutex a, mon_t * mutex b, long long int * out ) { 157 157 long long int StartTime, EndTime; 158 158 … … 168 168 } 169 169 170 void side2B( mon_t & mutex a, mon_t &mutex b ) {170 void side2B( mon_t * mutex a, mon_t * mutex b ) { 171 171 for( int i = 0;; i++ ) { 172 172 signal(&cond2b); … … 176 176 } 177 177 178 void main( thrd2a & this ) { side2A( mon1, mon2, this.out ); }179 void main( thrd2b & this ) { side2B( mon1,mon2 ); }178 void main( thrd2a * this ) { side2A( &mon1, &mon2, this->out ); } 179 void main( thrd2b * this ) { side2B( &mon1, &mon2 ); } 180 180 181 181 long long int measure_2_sched_int() {
Note:
See TracChangeset
for help on using the changeset viewer.