- Timestamp:
- Jun 10, 2020, 12:07:36 PM (5 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 6089f4d
- Parents:
- 591f084
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/theses/thierry_delisle_PhD/code/relaxed_list.hpp
r591f084 r03045f18 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++; … … 235 237 if(auto node = try_pop(i, j)) return node; 236 238 } 239 /*/ 240 while(snzm.query()) { 241 // Pick two lists at random 242 int i = tls.rng.next() % numLists; 243 int j = tls.rng.next() % numLists; 244 245 if(auto node = try_pop(i, j)) return node; 246 } 247 //*/ 237 248 #elif VARIANT == BITMASK 238 249 int nnempty; … … 329 340 assert(qword == 0); 330 341 __attribute__((unused)) bool ret = btr(tls.mask, bit); 331 snz i.depart(w);342 snzm.depart(w); 332 343 #elif VARIANT == SNZI 333 344 snzi.depart(w); … … 500 511 const unsigned numLists; 501 512 private: 502 #if VARIANT == SNZI || VARIANT == DISCOVER513 #if VARIANT == SNZI 503 514 snzi_t snzi; 504 #elif VARIANT == SNZM 515 #elif VARIANT == SNZM || VARIANT == DISCOVER 505 516 snzm_t snzm; 506 517 #else … … 591 602 double pop_sur = (100.0 * double(global.pick.pop .success) / global.pick.pop .attempt); 592 603 double mpop_sur = (100.0 * double(global.pick.pop .success) / global.pick.pop .mask_attempt); 593 double rpop_sur = (100.0 * double(global.pick.pop .mask_reset) / global.pick.pop .mask_attempt); 594 595 os << "Push Pick % : " << push_sur << "(" << global.pick.push.success << " / " << global.pick.push.attempt << ")\n"; 596 os << "Pop Pick % : " << pop_sur << "(" << global.pick.pop .success << " / " << global.pick.pop .attempt << ")\n"; 597 os << "TryPop Pick % : " << mpop_sur << "(" << global.pick.pop .success << " / " << global.pick.pop .mask_attempt << ")\n"; 598 os << "Pop M Reset % : " << rpop_sur << "(" << global.pick.pop .mask_reset << " / " << global.pick.pop .mask_attempt << ")\n"; 604 double rpop_sur = (100.0 * double(global.pick.pop .success) / global.pick.pop .mask_reset); 605 606 double push_len = double(global.pick.push.attempt ) / global.pick.push.success; 607 double pop_len = double(global.pick.pop .attempt ) / global.pick.pop .success; 608 double mpop_len = double(global.pick.pop .mask_attempt) / global.pick.pop .success; 609 double rpop_len = double(global.pick.pop .mask_reset ) / global.pick.pop .success; 610 611 os << "Push Pick : " << push_sur << " %, len " << push_len << " (" << global.pick.push.attempt << " / " << global.pick.push.success << ")\n"; 612 os << "Pop Pick : " << pop_sur << " %, len " << pop_len << " (" << global.pick.pop .attempt << " / " << global.pick.pop .success << ")\n"; 613 os << "TryPop Pick : " << mpop_sur << " %, len " << mpop_len << " (" << global.pick.pop .mask_attempt << " / " << global.pick.pop .success << ")\n"; 614 os << "Pop M Reset : " << rpop_sur << " %, len " << rpop_len << " (" << global.pick.pop .mask_reset << " / " << global.pick.pop .success << ")\n"; 599 615 600 616 double avgQ_push = double(global.qstat.push.value) / global.qstat.push.count;
Note: See TracChangeset
for help on using the changeset viewer.