Changes in / [5f259f3:a5873bd]
- Location:
- doc/theses/thierry_delisle_PhD/code
- Files:
-
- 2 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/theses/thierry_delisle_PhD/code/relaxed_list.hpp
r5f259f3 ra5873bd 73 73 "SNZI", 74 74 "BITMASK", 75 " DISCOVER",75 "SNZI + DISCOVERED MASK", 76 76 "SNZI + MASK" 77 77 }; … … 82 82 : lists(new intrusive_queue_t[numLists]) 83 83 , numLists(numLists) 84 #if VARIANT == SNZI || VARIANT == DISCOVER84 #if VARIANT == SNZI 85 85 , snzi( std::log2( numLists / 8 ), 2 ) 86 #elif VARIANT == SNZM 86 #elif VARIANT == SNZM || VARIANT == DISCOVER 87 87 , snzm( numLists ) 88 88 #endif … … 128 128 assert(qword == 0); 129 129 bts(tls.mask, bit); 130 snz i.arrive(i);130 snzm.arrive(i); 131 131 #elif VARIANT == SNZI 132 132 snzi.arrive(i); … … 166 166 #if VARIANT == DISCOVER 167 167 assert(numLists <= 64); 168 while(snz i.query()) {168 while(snzm.query()) { 169 169 tls.pick.pop.mask_attempt++; 170 170 unsigned i, j; … … 180 180 tls.pick.pop.mask_reset++; 181 181 mask = (1U << numLists) - 1; 182 tls.mask.store(mask, std::memory_order_relaxed); 182 183 } 183 184 … … 202 203 } 203 204 #elif VARIANT == SNZM 205 //* 204 206 while(snzm.query()) { 205 207 tls.pick.pop.mask_attempt++; … … 246 248 if(auto node = try_pop(i, j)) return node; 247 249 } 250 /*/ 251 while(snzm.query()) { 252 // Pick two lists at random 253 int i = tls.rng.next() % numLists; 254 int j = tls.rng.next() % numLists; 255 256 if(auto node = try_pop(i, j)) return node; 257 } 258 //*/ 248 259 #elif VARIANT == BITMASK 249 260 int nnempty; … … 340 351 assert(qword == 0); 341 352 __attribute__((unused)) bool ret = btr(tls.mask, bit); 342 snz i.depart(w);353 snzm.depart(w); 343 354 #elif VARIANT == SNZI 344 355 snzi.depart(w); … … 511 522 const unsigned numLists; 512 523 private: 513 #if VARIANT == SNZI || VARIANT == DISCOVER524 #if VARIANT == SNZI 514 525 snzi_t snzi; 515 #elif VARIANT == SNZM 526 #elif VARIANT == SNZM || VARIANT == DISCOVER 516 527 snzm_t snzm; 517 528 #else … … 602 613 double pop_sur = (100.0 * double(global.pick.pop .success) / global.pick.pop .attempt); 603 614 double mpop_sur = (100.0 * double(global.pick.pop .success) / global.pick.pop .mask_attempt); 604 double rpop_sur = (100.0 * double(global.pick.pop .mask_reset) / global.pick.pop .mask_attempt); 605 606 os << "Push Pick % : " << push_sur << "(" << global.pick.push.success << " / " << global.pick.push.attempt << ")\n"; 607 os << "Pop Pick % : " << pop_sur << "(" << global.pick.pop .success << " / " << global.pick.pop .attempt << ")\n"; 608 os << "TryPop Pick % : " << mpop_sur << "(" << global.pick.pop .success << " / " << global.pick.pop .mask_attempt << ")\n"; 609 os << "Pop M Reset % : " << rpop_sur << "(" << global.pick.pop .mask_reset << " / " << global.pick.pop .mask_attempt << ")\n"; 615 double rpop_sur = (100.0 * double(global.pick.pop .success) / global.pick.pop .mask_reset); 616 617 double push_len = double(global.pick.push.attempt ) / global.pick.push.success; 618 double pop_len = double(global.pick.pop .attempt ) / global.pick.pop .success; 619 double mpop_len = double(global.pick.pop .mask_attempt) / global.pick.pop .success; 620 double rpop_len = double(global.pick.pop .mask_reset ) / global.pick.pop .success; 621 622 os << "Push Pick : " << push_sur << " %, len " << push_len << " (" << global.pick.push.attempt << " / " << global.pick.push.success << ")\n"; 623 os << "Pop Pick : " << pop_sur << " %, len " << pop_len << " (" << global.pick.pop .attempt << " / " << global.pick.pop .success << ")\n"; 624 os << "TryPop Pick : " << mpop_sur << " %, len " << mpop_len << " (" << global.pick.pop .mask_attempt << " / " << global.pick.pop .success << ")\n"; 625 os << "Pop M Reset : " << rpop_sur << " %, len " << rpop_len << " (" << global.pick.pop .mask_reset << " / " << global.pick.pop .success << ")\n"; 610 626 611 627 double avgQ_push = double(global.qstat.push.value) / global.qstat.push.count;
Note: See TracChangeset
for help on using the changeset viewer.