Lines Matching defs:victim

972     // Other threads will inspect this variable when searching for a victim.
1213 // TODO: algorithm of searching for a victim
1219 dispatch_private_info_template<T> *victim =
1223 while ((victim == NULL || victim == pr ||
1224 (*(volatile T *)&victim->u.p.static_steal_counter !=
1228 victim = reinterpret_cast<dispatch_private_info_template<T> *>(
1232 if (!victim || (*(volatile T *)&victim->u.p.static_steal_counter !=
1235 // no victim is ready yet to participate in stealing
1238 if (victim->u.p.count + 2 > (UT)victim->u.p.ub) {
1240 continue; // not enough chunks to steal, goto next victim
1246 limit = victim->u.p.ub; // keep initial ub
1247 if (victim->u.p.count >= limit ||
1248 (remaining = limit - victim->u.p.count) < 2) {
1250 pr->u.p.parm4 = (victimIdx + 1) % nproc; // next victim
1253 // stealing succeded, reduce victim's ub by 1/4 of undone chunks or
1258 init = (victim->u.p.ub -= (remaining >> 2));
1262 init = (victim->u.p.ub -= 1);
1267 pr->u.p.parm4 = victimIdx; // remember victim to steal from
1275 } // while (search for victim)
1276 } // if (try to find victim and steal)
1312 // TODO: algorithm of searching for a victim
1319 dispatch_private_info_template<T> *victim =
1323 while ((victim == NULL || victim == pr ||
1324 (*(volatile T *)&victim->u.p.static_steal_counter !=
1328 victim = reinterpret_cast<dispatch_private_info_template<T> *>(
1332 if (!victim || (*(volatile T *)&victim->u.p.static_steal_counter !=
1335 // no victim is ready yet to participate in stealing
1338 pr->u.p.parm4 = victimIdx; // new victim found
1339 while (1) { // CAS loop if victim has enough chunks to steal
1340 vold.b = *(volatile kmp_int64 *)(&victim->u.p.count);
1346 pr->u.p.parm4 = (victimIdx + 1) % nproc; // shift start victim id
1347 break; // not enough chunks to steal, goto next victim
1357 (volatile kmp_int64 *)&victim->u.p.count,
1376 } // while (try to steal from particular victim)
1377 } // while (search for victim)
1378 } // if (try to find victim and steal)