Changeset: 60c308542314 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=60c308542314
Modified Files:
        monetdb5/mal/mal_dataflow.c
Branch: default
Log Message:

Make sure memory claims are released


diffs (57 lines):

diff --git a/monetdb5/mal/mal_dataflow.c b/monetdb5/mal/mal_dataflow.c
--- a/monetdb5/mal/mal_dataflow.c
+++ b/monetdb5/mal/mal_dataflow.c
@@ -254,18 +254,18 @@ DFLOWworker(void *t)
                        continue;
                }
 
-#ifdef USE_MAL_ADMISSION
-               if (MALadmission(fe->argclaim, fe->hotclaim)) {
-                       fe->hotclaim = 0;   /* don't assume priority anymore */
-                       if (todo->last == 0)
-                               MT_sleep_ms(DELAYUNIT);
-                       q_requeue(todo, fe);
-                       continue;
-               }
-#endif
+               usec = GDKusec();
                /* skip all instructions when we have encontered an error */
                if (flow->error == 0) {
-                       usec = GDKusec();
+#ifdef USE_MAL_ADMISSION
+                       if (MALadmission(fe->argclaim, fe->hotclaim)) {
+                               fe->hotclaim = 0;   /* don't assume priority 
anymore */
+                               if (todo->last == 0)
+                                       MT_sleep_ms(DELAYUNIT);
+                               q_requeue(todo, fe);
+                               continue;
+                       }
+#endif
                        error = runMALsequence(flow->cntxt, flow->mb, fe->pc, 
fe->pc + 1, flow->stk, 0, 0);
                        PARDEBUG mnstr_printf(GDKstdout, "#executed pc= %d wrk= 
%d claim= " LLFMT "," LLFMT " %s\n",
                                                                  fe->pc, id, 
fe->argclaim, fe->hotclaim, error ? error : "");
@@ -296,8 +296,6 @@ DFLOWworker(void *t)
                        }
                }
 
-               PARDEBUG mnstr_printf(GDKstdout, "#execute pc= %d wrk= %d 
finished %s\n", fe->pc, id, flow->error ? flow->error : "");
-
                /* see if you can find an eligible instruction that uses the
                 * result just produced. Then we can continue with it right 
away.
                 * We are just looking forward for the last block, which means 
we
@@ -518,14 +516,9 @@ DFLOWscheduler(DataFlow flow)
                /*
                 * When an instruction is finished we have to reduce the blocked
                 * counter for all dependent instructions.  for those where it
-                * drops to zero we can scheduler it Moreover, we add the return
-                * variable claim size to the target instruction and remember
-                * the last increment as hotclaim.
+                * drops to zero we can scheduler it we do it here instead of 
the scheduler
                 */
 
-               /* enter all dependencies before releasing the queue  */
-               /* otherwise you can be overtaken by a worker */
-
                for (last = f->pc - flow->start; last >= 0 && (i = 
flow->nodes[last]) > 0; last = flow->edges[last])
                        if (flow->status[i].state == DFLOWpending) {
                                flow->status[i].argclaim += f->hotclaim;
_______________________________________________
checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to