Changeset: b2114ef5e102 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b2114ef5e102
Modified Files:
monetdb5/mal/mal_interpreter.mx
Branch: Apr2011
Log Message:
Avoid double activation
It could happen that the same instruction is scheduled twice
for execution by different threads. That is calling for problems.
The break out of both loops is needed to avoid it.
diffs (35 lines):
diff --git a/monetdb5/mal/mal_interpreter.mx b/monetdb5/mal/mal_interpreter.mx
--- a/monetdb5/mal/mal_interpreter.mx
+++ b/monetdb5/mal/mal_interpreter.mx
@@ -1429,7 +1429,7 @@
oa = getArg(p,j);
/* find the last instruction that should be
inspected for eligibility */
if ( getEndOfLife(flow->mb,oa) > lookahead)
- lookahead = getEndOfLife(flow->mb,oa);
+ lookahead = getEndOfLife(flow->mb,oa)
+1;
flow->blocked[oa] = 0;
flow->inuse[oa] = 0;
@@ -1450,9 +1450,9 @@
lookahead = limit;
if (flow->stk->admit == 0) {
- @:DFLOWscheduler_body( DFLOWeligible(flow,fs,i,p,pc) )@
+ @:DFLOWscheduler_body( DFLOWeligible(flow,fs,i,p,pc),
foundit1 )@
} else {
- @:DFLOWscheduler_body( DFLOWeligible(flow,fs,i,p,pc) &&
(*flow->stk->admit)(flow->cntxt, flow->mb, flow->stk, p) )@
+ @:DFLOWscheduler_body( DFLOWeligible(flow,fs,i,p,pc) &&
(*flow->stk->admit)(flow->cntxt, flow->mb, flow->stk, p), foundit2 )@
}
@= DFLOWscheduler_body
/* first try to find an instructions that use the released
target */
@@ -1471,8 +1471,9 @@
DFLOWactivate(flow,fs,i,p);
q_enqueue(flow->todo,
fs+i);
}
- break;
+ goto @2;
}
+ @2: /* it can only be activated once */;
}
/* if all work done then inspect rest */
if (candidates < flow->nway)
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list