Changes in benchmark/readyQ/transfer.cpp [65c9208:6dc2db9]
- File:
-
- 1 edited
-
benchmark/readyQ/transfer.cpp (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
benchmark/readyQ/transfer.cpp
r65c9208 r6dc2db9 12 12 13 13 bool exhaust = false; 14 volatile bool estop = false;15 14 16 15 bench_sem the_main; … … 43 42 if( to_miliseconds(timeHiRes() - start) > 5'000 ) { 44 43 std::cerr << "Programs has been blocked for more than 5 secs" << std::endl; 45 estop = true; 46 the_main.post(); 47 goto END; 44 std::exit(1); 48 45 } 49 46 } 50 47 } 51 END:;52 48 PRINT( std::cout | "Waiting done"; ) 53 49 } … … 63 59 void lead() { 64 60 this->idx = ++lead_idx; 65 if(lead_idx > stop_count || estop) {61 if(lead_idx > stop_count) { 66 62 PRINT( std::cout << "Leader " << this->id << " done" << std::endl; ) 67 63 the_main.post(); … … 92 88 } 93 89 94 static void main( MyThread * arg) {95 MyThread & self = * arg;90 static void main(void * arg) { 91 MyThread & self = *reinterpret_cast<MyThread*>(arg); 96 92 self.park(); 97 93 … … 105 101 self.wait(); 106 102 } 107 if(lead_idx > stop_count || estop) break;103 if(lead_idx > stop_count) break; 108 104 } 109 105 } … … 148 144 for(size_t i = 0; i < nthreads; i++) { 149 145 threads[i] = new MyThread( i ); 150 handles[i] = new Fibre(); 151 handles[i]->run( MyThread::main, threads[i] ); 146 handles[i] = new Fibre( MyThread::main, threads[i] ); 152 147 } 153 148 … … 169 164 PRINT( std::cout << i << " joined" << std::endl; ) 170 165 rechecks += thrd.rechecks; 166 // delete( handles[i] ); 171 167 delete( threads[i] ); 172 168 } … … 180 176 std::cout << "Number of processors : " << nprocs << std::endl; 181 177 std::cout << "Number of threads : " << nthreads << std::endl; 182 std::cout << "Total Operations(ops) : " << (lead_idx - 1)<< std::endl;178 std::cout << "Total Operations(ops) : " << stop_count << std::endl; 183 179 std::cout << "Threads parking on wait : " << (exhaust ? "yes" : "no") << std::endl; 184 180 std::cout << "Rechecking : " << rechecks << std::endl; 185 std::cout << "ns per transfer : " << std::fixed << (((double)(end - start)) / (lead_idx)) << std::endl;186 181 187 182
Note:
See TracChangeset
for help on using the changeset viewer.