Changeset: 569d27bd78f8 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=569d27bd78f8
Modified Files:
        gdk/gdk_bbp.c
        gdk/gdk_utils.c
        monetdb5/mal/mal_instruction.c
        monetdb5/mal/mal_instruction.h
Branch: default
Log Message:

Merge with Feb2013 branch.


diffs (95 lines):

diff --git a/gdk/gdk_bbp.c b/gdk/gdk_bbp.c
--- a/gdk/gdk_bbp.c
+++ b/gdk/gdk_bbp.c
@@ -100,6 +100,7 @@ BBPrec *BBP[N_BBPINIT];             /* fixed base V
 bat BBPlimit = 0;              /* current committed VM BBP array */
 bat BBPsize = 0;               /* current used size of BBP array */
 
+#define KITTENNAP 2 * GDKnr_threads    /* used to suspend processing */
 #define BBPNONAME "."          /* filler for no name in BBP.dir */
 /*
  * The hash index uses a bucket index (int array) of size mask that is
@@ -1926,7 +1927,7 @@ BBPspin(bat i, str s, int event)
                lng spin = LL_CONSTANT(0);
 
                while (BBP_status(i) & event) {
-                       MT_sleep_ms(1);
+                       MT_sleep_ms(KITTENNAP);
                        spin++;
                }
                BATDEBUG THRprintf(GDKstdout, "#BBPspin(%d,%s,%d): " LLFMT " 
loops\n", (int) i, s, event, spin);
@@ -1961,7 +1962,7 @@ incref(bat i, int logical, int lock)
                                break;
                        /* the BATs is "unstable", try again */
                        MT_lock_unset(&GDKswapLock(i), "BBPincref");
-                       MT_sleep_ms(1);
+                       MT_sleep_ms(KITTENNAP);
                }
        }
        /* we have the lock */
@@ -2306,7 +2307,7 @@ getBBPdescriptor(bat i, int lock)
                while (BBP_status(j) & BBPWAITING) {    /* wait for bat to be 
loaded by other thread */
                        if (lock)
                                MT_lock_unset(&GDKswapLock(j), "BBPdescriptor");
-                       MT_sleep_ms(1);
+                       MT_sleep_ms(KITTENNAP);
                        if (lock)
                                MT_lock_set(&GDKswapLock(j), "BBPdescriptor");
                }
diff --git a/gdk/gdk_utils.c b/gdk/gdk_utils.c
--- a/gdk/gdk_utils.c
+++ b/gdk/gdk_utils.c
@@ -1034,6 +1034,7 @@ GDKmunmap(void *addr, size_t size)
  * Their value is turned into a blanc space.
  */
 
+#define CATNAP 500
 int GDKrecovery = 0;
 
 static MT_Id GDKvmtrim_id;
@@ -1053,8 +1054,8 @@ GDKvmtrim(void *limit)
                size_t cursize;
 
                /* sleep using catnaps so we can exit in a timely fashion */
-               for (t = highload ? 500 : 5000; t > 0; t -= 50) {
-                       MT_sleep_ms(50);
+               for (t = highload ? CATNAP : 10 * CATNAP; t > 0; t -= CATNAP) {
+                       MT_sleep_ms(CATNAP);
                        if (GDKexiting())
                                return;
                }
diff --git a/monetdb5/mal/mal_instruction.c b/monetdb5/mal/mal_instruction.c
--- a/monetdb5/mal/mal_instruction.c
+++ b/monetdb5/mal/mal_instruction.c
@@ -1590,12 +1590,6 @@ delArgument(InstrPtr p, int idx)
                p->retc--;
 }
 
-int
-getGDKType(int tpe)
-{
-       return tpe <= TYPE_str ? tpe : (tpe == TYPE_any ? TYPE_void : 
findGDKtype(tpe));
-}
-
 void
 setVarType(MalBlkPtr mb, int i, int tpe)
 {
diff --git a/monetdb5/mal/mal_instruction.h b/monetdb5/mal/mal_instruction.h
--- a/monetdb5/mal/mal_instruction.h
+++ b/monetdb5/mal/mal_instruction.h
@@ -171,6 +171,7 @@ typedef struct MALBLK {
 #define getVarType(M,I)                ((M)->var[I]->type)
 #define getVarGDKType(M,I)     getGDKType((M)->var[I]->type)
 #define ignoreVar(M,I)         ((M)->var[I]->type == TYPE_ptr? 1: 0)
+#define getGDKType(T)          ( T <= TYPE_str ? T : (T == TYPE_any ? 
TYPE_void : findGDKtype(T)))
 
 #define clrVarFixed(M,I)               ((M)->var[I]->flags &= ~VAR_FIXTYPE)
 #define setVarFixed(M,I)               ((M)->var[I]->flags |= VAR_FIXTYPE)
@@ -229,7 +230,6 @@ mal_export Symbol newSymbol(str nme, int
 mal_export void freeSymbol(Symbol s);
 mal_export void freeSymbolList(Symbol s);
 mal_export void printSignature(stream *fd, Symbol s, int flg);
-mal_export int getGDKType(int tpe);
 
 mal_export MalBlkPtr newMalBlk(int maxvars, int maxstmts);
 mal_export void resetMalBlk(MalBlkPtr mb, int stop);
_______________________________________________
checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to