Changeset 52769ba for libcfa/src/concurrency/ready_queue.cfa
- Timestamp:
- Jun 24, 2020, 1:40:35 PM (4 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:
- c7816be
- Parents:
- de917da3
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/ready_queue.cfa
rde917da3 r52769ba 219 219 thrd->link.ts = rdtscl(); 220 220 221 #if defined(BIAS) && !defined(__CFA_NO_STATISTICS__) 222 bool local = false; 223 #endif 224 221 225 // Try to pick a lane and lock it 222 226 unsigned i; … … 234 238 235 239 #if !defined(__CFA_NO_STATISTICS__) 240 local = true; 236 241 __tls_stats()->ready.pick.push.local++; 237 242 #endif … … 241 246 // Use all queues 242 247 i = rhigh; 248 local = false; 243 249 } 244 250 #else … … 276 282 // Update statistics 277 283 #if !defined(__CFA_NO_STATISTICS__) 284 #if defined(BIAS) 285 if( local ) __tls_stats()->ready.pick.push.lsuccess++; 286 #endif 278 287 __tls_stats()->ready.pick.push.success++; 279 288 #endif … … 299 308 unsigned i,j; 300 309 #if defined(BIAS) 310 #if !defined(__CFA_NO_STATISTICS__) 311 bool local = false; 312 #endif 301 313 uint64_t r = __tls_rand(); 302 314 unsigned rlow = r % BIAS; … … 313 325 314 326 #if !defined(__CFA_NO_STATISTICS__) 327 local = true; 315 328 __tls_stats()->ready.pick.pop.local++; 316 329 #endif … … 332 345 // try popping from the 2 picked lists 333 346 struct $thread * thrd = try_pop(cltr, i, j); 334 if(thrd) return thrd; 347 if(thrd) { 348 #if defined(BIAS) && !defined(__CFA_NO_STATISTICS__) 349 if( local ) __tls_stats()->ready.pick.pop.lsuccess++; 350 #endif 351 return thrd; 352 } 335 353 } 336 354
Note: See TracChangeset
for help on using the changeset viewer.