Update of /cvsroot/monetdb/MonetDB5/src/mal
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv10227
Modified Files:
mal.mx mal_recycle.mx
Log Message:
Trigger a recycle shutdown.
Index: mal_recycle.mx
===================================================================
RCS file: /cvsroot/monetdb/MonetDB5/src/mal/mal_recycle.mx,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- mal_recycle.mx 9 Mar 2008 11:51:05 -0000 1.20
+++ mal_recycle.mx 9 Mar 2008 15:39:26 -0000 1.21
@@ -80,6 +80,7 @@
mal_export void RECYCLEversion(MalBlkPtr mb);
mal_export int RECYCLEentry(MalBlkPtr mb, MalStkPtr stk, InstrPtr p);
mal_export void RECYCLEexit(MalBlkPtr mb, MalStkPtr stk, InstrPtr p);
+mal_export void RECYCLEshutdown();
#endif
@-
@c
@@ -315,7 +316,7 @@
@c
if( VALcmp( &s->stk[getArg(p,2)],
&getVar(recycleBlk,getArg(q,2))->value) >=0 &&
- ( p->argc == 3 ||
+ ( p->argc == 4 ||
VALcmp( &s->stk[getArg(p,3)],
&getVar(recycleBlk,getArg(q,3))->value) <=0 ) ){
BAT *b1, *b2;
@@ -470,4 +471,35 @@
}
}
}
[EMAIL PROTECTED]
+At the end of the session we should remove all
+intermediate results forcefully. This only amounts
+to resetting the reference counts of the persistent
+tables, because all others are garbage collected automatically.
+To simplify the code, we just drop all BAT reference counts by one.
[EMAIL PROTECTED]
+void
+RECYCLEshutdown(){
+ InstrPtr q;
+ int i,j;
+ MalBlkPtr mb;
+
+ if( recycleBlk == NULL)
+ return ;
+
+ mal_set_lock(recycleLock,"recycle");
+ mb= recycleBlk;
+ recycleBlk= NULL;
+ mal_unset_lock(recycleLock,"recycle");
+
+ for(i=0; i< mb->stop; i++){
+ q= getInstrPtr(mb,i);
+ for(j=0; j< q->argc; j++)
+ if( isVarConstant(mb,getArg(q,j)) ){
+ if( isaBatType(getArgType(mb, q,j)) )
+
BBPdecref(getVarConstant(mb,getArg(q,j)).val.bval,TRUE);
+ }
+ }
+ freeMalBlk(mb);
+}
@}
Index: mal.mx
===================================================================
RCS file: /cvsroot/monetdb/MonetDB5/src/mal/mal.mx,v
retrieving revision 1.137
retrieving revision 1.138
diff -u -d -r1.137 -r1.138
--- mal.mx 4 Mar 2008 20:14:33 -0000 1.137
+++ mal.mx 9 Mar 2008 15:39:25 -0000 1.138
@@ -364,6 +364,7 @@
int t = 0;
str err;
+ RECYCLEshutdown(); /* remove any left over intermediates */
@-
Before continuing we should make sure that all clients
(except the console) have left the scene.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Monetdb-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-checkins