bugs resolved
This commit is contained in:
parent
2be99a944f
commit
7c4c43b996
|
@ -116,7 +116,7 @@ static void *schedulerMain(void *scheduler)
|
||||||
while (!args->pleaseStop && (nPartialCycles / ncpu) <= args->nmaxCycles) {
|
while (!args->pleaseStop && (nPartialCycles / ncpu) <= args->nmaxCycles) {
|
||||||
//printLog("Scheduler #%lu online: cycle %d\n", *args->id, ncycles);
|
//printLog("Scheduler #%lu online: cycle %d\n", *args->id, ncycles);
|
||||||
|
|
||||||
// XXX statistics here
|
// TODO statistics here
|
||||||
|
|
||||||
// Create a new thread
|
// Create a new thread
|
||||||
if (nworker < ncpu) {
|
if (nworker < ncpu) {
|
||||||
|
@ -124,10 +124,10 @@ static void *schedulerMain(void *scheduler)
|
||||||
workArea = NULL;
|
workArea = NULL;
|
||||||
|
|
||||||
// Acquiring lock to consistently read the arrowArray
|
// Acquiring lock to consistently read the arrowArray
|
||||||
if (acquireNonBlockinArrowgLock(args->arrowArray)) { //XXX does not return 0
|
if (acquireNonBlockinArrowgLock(args->arrowArray)) {
|
||||||
// Random choice of an arrow
|
// Random choice of an arrow
|
||||||
electedArrow =
|
electedArrow =
|
||||||
&args->arrowArray->array[rand() % args->arrowArray->size]; // XXX size is 0
|
&args->arrowArray->array[rand() % args->arrowArray->size];
|
||||||
|
|
||||||
// Find a local area
|
// Find a local area
|
||||||
workArea = findWorkArea(centersList, electedArrow, args->ruleRadius,
|
workArea = findWorkArea(centersList, electedArrow, args->ruleRadius,
|
||||||
|
|
Loading…
Reference in New Issue