disable Timer interrupt and some bug fixing
authorjzhou <jzhou>
Fri, 16 Apr 2010 00:04:34 +0000 (00:04 +0000)
committerjzhou <jzhou>
Fri, 16 Apr 2010 00:04:34 +0000 (00:04 +0000)
Robust/src/Runtime/multicoregarbage.c
Robust/src/Runtime/multicoreruntime.h
Robust/src/Runtime/multicoretask.c

index e118ce1169cae2dadd86c6d0ce9ab4a37c136665..aa9a52b4926d95b4b5e1c4e926677f3a7112f314 100644 (file)
@@ -448,7 +448,7 @@ inline void checkMarkStatue() {
        for(i = 1; i < NUMCORESACTIVE; ++i) {
          gccorestatus[i] = 1;
          // send mark phase finish confirm request msg to core i
-         send_msg_1(i, GCMARKCONFIRM);
+         send_msg_1(i, GCMARKCONFIRM, false);
        }                         // for(i = 1; i < NUMCORESACTIVE; ++i)
       } else {
        // check if the sum of send objs and receive obj are the same
@@ -478,7 +478,7 @@ inline void checkMarkStatue() {
          // restore the gcstatus for all cores
          for(i = 0; i < NUMCORESACTIVE; ++i) {
            gccorestatus[i] = 1;
-         }                               // for(i = 0; i < NUMCORESACTIVE; ++i)
+         }  // for(i = 0; i < NUMCORESACTIVE; ++i)
        } else {
          // wait for a while and ask for confirm again
          int h = 100;
@@ -513,7 +513,7 @@ inline bool preGC() {
     for(i = 1; i < NUMCORESACTIVE; ++i) {
       corestatus[i] = 1;
       // send status confirm msg to core i
-      send_msg_1(i, STATUSCONFIRM);
+      send_msg_1(i, STATUSCONFIRM, false);
     }             // for(i = 1; i < NUMCORESACTIVE; ++i)
 
 #ifdef DEBUG
@@ -980,7 +980,7 @@ inline void moveLObjs() {
 #endif
        if(host != BAMBOO_NUM_OF_CORE) {
          // send the original host core with the mapping info
-         send_msg_3(host, GCLOBJMAPPING, ptr, tmpheaptop);
+         send_msg_3(host, GCLOBJMAPPING, ptr, tmpheaptop, false);
 #ifdef DEBUG
          BAMBOO_DEBUGPRINT(0xcdcb);
          BAMBOO_DEBUGPRINT_REG(ptr);
@@ -1065,7 +1065,7 @@ inline void moveLObjs() {
 #endif
        if(host != BAMBOO_NUM_OF_CORE) {
          // send the original host core with the mapping info
-         send_msg_3(host, GCLOBJMAPPING, ptr, tmpheaptop);
+         send_msg_3(host, GCLOBJMAPPING, ptr, tmpheaptop, false);
 #ifdef DEBUG
          BAMBOO_DEBUGPRINT(0xcdcd);
          BAMBOO_DEBUGPRINT_REG(ptr);
@@ -1141,7 +1141,7 @@ inline void markObj(void * objptr) {
        unsigned long long ttime = BAMBOO_GET_EXE_TIME();
 #endif
        // send a msg to host informing that objptr is active
-       send_msg_2(host, GCMARKEDOBJ, objptr);
+       send_msg_2(host, GCMARKEDOBJ, objptr, false);
 #ifdef GC_PROFILE
        marktime += BAMBOO_GET_EXE_TIME() - ttime;
        num_markrequest++;
@@ -1426,7 +1426,7 @@ inline void mark(bool isfirst,
        BAMBOO_DEBUGPRINT(0xed09);
 #endif
        send_msg_4(STARTUPCORE, GCFINISHMARK, BAMBOO_NUM_OF_CORE,
-                  gcself_numsendobjs, gcself_numreceiveobjs);
+                  gcself_numsendobjs, gcself_numreceiveobjs, false);
        sendStall = true;
       }
     }             // if(STARTUPCORE == BAMBOO_NUM_OF_CORE) ...
@@ -1455,7 +1455,7 @@ inline void compact2Heaptophelper_I(int coren,
     gcdstcore = gctopcore;
     gcblock2fill = *numblocks + 1;
   } else {
-    send_msg_4(coren, GCMOVESTART, gctopcore, *p, (*numblocks) + 1);
+    send_msg_4(coren, GCMOVESTART, gctopcore, *p, (*numblocks) + 1, false);
   }
 #ifdef DEBUG
   BAMBOO_DEBUGPRINT_REG(coren);
@@ -1637,7 +1637,7 @@ inline void resolvePendingMoveRequest() {
        BAMBOO_DEBUGPRINT(0xeb04);
 #endif
        send_msg_4(dstcore, GCMOVESTART, sourcecore,
-                  startaddr, tomove);
+                  startaddr, tomove, false);
       }
       gcmovepending--;
       nosparemem = true;
@@ -2099,7 +2099,7 @@ innercompact:
       // ask for more mem
       gctomove = false;
       send_msg_5(STARTUPCORE, GCFINISHCOMPACT, BAMBOO_NUM_OF_CORE,
-                 *filledblocks, *heaptopptr, gccurr_heaptop);
+                 *filledblocks, *heaptopptr, gccurr_heaptop, false);
     } else {
 #ifdef DEBUG
       BAMBOO_DEBUGPRINT(0xe108);
@@ -2107,7 +2107,7 @@ innercompact:
 #endif
       // finish compacting
       send_msg_5(STARTUPCORE, GCFINISHCOMPACT, BAMBOO_NUM_OF_CORE,
-                 *filledblocks, *heaptopptr, 0);
+                 *filledblocks, *heaptopptr, 0, false);
     }
   }       // if(STARTUPCORE == BAMBOO_NUM_OF_CORE)
 
@@ -2172,7 +2172,7 @@ inline void compact() {
     BAMBOO_DEBUGPRINT_REG(to->base);
 #endif
     send_msg_5(STARTUPCORE, GCFINISHCOMPACT, BAMBOO_NUM_OF_CORE,
-               0, to->base, 0);
+               0, to->base, 0, false);
     RUNFREE(orig);
     RUNFREE(to);
     return;
@@ -2248,7 +2248,7 @@ inline void * flushObj(void * objptr) {
        // the first time require the mapping, send msg to the hostcore
        // for the mapping info
        send_msg_3(hostcore(objptr), GCMAPREQUEST, (int)objptr,
-                  BAMBOO_NUM_OF_CORE);
+                  BAMBOO_NUM_OF_CORE, false);
        while(true) {
          if(gcismapped) {
            break;
@@ -2587,7 +2587,7 @@ inline void flush(struct garbagelist * stackptr) {
   if(STARTUPCORE == BAMBOO_NUM_OF_CORE) {
     gccorestatus[BAMBOO_NUM_OF_CORE] = 0;
   } else {
-    send_msg_2(STARTUPCORE, GCFINISHFLUSH, BAMBOO_NUM_OF_CORE);
+    send_msg_2(STARTUPCORE, GCFINISHFLUSH, BAMBOO_NUM_OF_CORE, false);
   }
 #ifdef GC_PROFILE
   if(BAMBOO_NUM_OF_CORE == 0) {
@@ -2616,7 +2616,7 @@ inline void gc_collect(struct garbagelist * stackptr) {
 #endif
   initGC();
   //send init finish msg to core coordinator
-  send_msg_2(STARTUPCORE, GCFINISHINIT, BAMBOO_NUM_OF_CORE);
+  send_msg_2(STARTUPCORE, GCFINISHINIT, BAMBOO_NUM_OF_CORE, false);
   while(true) {
     if(MARKPHASE == gcphase) {
       break;
@@ -2672,7 +2672,7 @@ inline void gc_nocollect(struct garbagelist * stackptr) {
 #endif
   initGC();
   //send init finish msg to core coordinator
-  send_msg_2(STARTUPCORE, GCFINISHINIT, BAMBOO_NUM_OF_CORE);
+  send_msg_2(STARTUPCORE, GCFINISHINIT, BAMBOO_NUM_OF_CORE, false);
   while(true) {
     if(MARKPHASE == gcphase) {
       break;
@@ -2750,7 +2750,7 @@ inline void gc(struct garbagelist * stackptr) {
     // Note: all cores need to init gc including non-gc cores
     for(i = 1; i < NUMCORESACTIVE /*NUMCORES4GC*/; i++) {
       // send GC init messages to all cores
-      send_msg_1(i, GCSTARTINIT);
+      send_msg_1(i, GCSTARTINIT, false);
     }
     bool isfirst = true;
     bool allStall = false;
@@ -2783,7 +2783,7 @@ inline void gc(struct garbagelist * stackptr) {
     for(i = 1; i < NUMCORESACTIVE /*NUMCORES4GC*/; ++i) {
       gccorestatus[i] = 1;
       // send GC start messages to all cores
-      send_msg_1(i, GCSTART);
+      send_msg_1(i, GCSTART, false);
     }
 
     gcphase = MARKPHASE;
@@ -2801,7 +2801,7 @@ inline void gc(struct garbagelist * stackptr) {
                    // Note: only need to ask gc cores, non-gc cores do not host any objs
     numconfirm = NUMCORES4GC - 1;
     for(i = 1; i < NUMCORES4GC; ++i) {
-      send_msg_1(i, GCLOBJREQUEST);
+      send_msg_1(i, GCLOBJREQUEST, false);
     }
     gcloads[BAMBOO_NUM_OF_CORE] = gccurr_heaptop;
     while(true) {
@@ -2859,14 +2859,14 @@ inline void gc(struct garbagelist * stackptr) {
       if (tmpcoreptr < tmpheaptop /*tmptopptr*/) {
        gcstopblock[i] = numpbc + 1;
        if(i != STARTUPCORE) {
-         send_msg_2(i, GCSTARTCOMPACT, numpbc+1);
+         send_msg_2(i, GCSTARTCOMPACT, numpbc+1, false);
        } else {
          gcblock2fill = numpbc+1;
        }                         // if(i != STARTUPCORE)
       } else {
        gcstopblock[i] = numpbc;
        if(i != STARTUPCORE) {
-         send_msg_2(i, GCSTARTCOMPACT, numpbc);
+         send_msg_2(i, GCSTARTCOMPACT, numpbc, false);
        } else {
          gcblock2fill = numpbc;
        }                         // if(i != STARTUPCORE)
@@ -3005,7 +3005,7 @@ inline void gc(struct garbagelist * stackptr) {
     for(i = 1; i < NUMCORESACTIVE /*NUMCORES4GC*/; ++i) {
       // send start flush messages to all cores
       gccorestatus[i] = 1;
-      send_msg_1(i, GCSTARTFLUSH);
+      send_msg_1(i, GCSTARTFLUSH, false);
     }
 #ifdef GC_PROFILE
     gc_profileItem();
@@ -3043,7 +3043,7 @@ inline void gc(struct garbagelist * stackptr) {
     gccorestatus[BAMBOO_NUM_OF_CORE] = 1;
     for(i = 1; i < NUMCORESACTIVE /*NUMCORES4GC*/; ++i) {
       // send gc finish messages to all cores
-      send_msg_1(i, GCFINISH);
+      send_msg_1(i, GCFINISH, false);
       gccorestatus[i] = 1;
     }
 #ifdef RAWPATH // TODO GC_DEBUG
index 838397d18118b5778a85bcfbc6bf59087a38ce64..c900617b6a62f1f845126c91472072c683189d50 100644 (file)
@@ -22,8 +22,8 @@ unsigned long long bamboo_start_time;
 #define BAMBOO_OUT_BUF_LENGTH 3000
 #define BAMBOO_MSG_BUF_LENGTH 3000
 int msgdata[BAMBOO_MSG_BUF_LENGTH];
-int msgdataindex;
-int msgdatalast;
+volatile int msgdataindex;
+volatile int msgdatalast;
 int msglength;
 volatile bool msgdatafull;
 int outmsgdata[BAMBOO_OUT_BUF_LENGTH];
@@ -31,7 +31,7 @@ int outmsgindex;
 int outmsglast;
 int outmsgleft;
 volatile bool isMsgHanging;
-volatile bool isMsgSending;
+//volatile bool isMsgSending;
 
 #define MSG_INDEXINC_I() \
   msgdataindex = (msgdataindex + 1) % (BAMBOO_MSG_BUF_LENGTH)
@@ -418,38 +418,40 @@ INLINE void processlockrelease(int locktype,
                                bool redirect);
 
 // msg related functions
-INLINE void send_hanging_msg();
+INLINE void send_hanging_msg(bool isInterrupt);
 INLINE void send_msg_1(int targetcore,
-                       unsigned long n0);
+                       unsigned long n0,
+                                          bool isInterrupt);
 INLINE void send_msg_2(int targetcore,
                        unsigned long n0,
-                       unsigned long n1);
+                       unsigned long n1,
+                                          bool isInterrupt);
 INLINE void send_msg_3(int targetcore,
                        unsigned long n0,
                        unsigned long n1,
-                       unsigned long n2);
+                       unsigned long n2,
+                                          bool isInterrupt);
 INLINE void send_msg_4(int targetcore,
                        unsigned long n0,
                        unsigned long n1,
                        unsigned long n2,
-                       unsigned long n3);
+                       unsigned long n3,
+                                          bool isInterrupt);
 INLINE void send_msg_5(int targetcore,
                        unsigned long n0,
                        unsigned long n1,
                        unsigned long n2,
                        unsigned long n3,
-                       unsigned long n4);
+                       unsigned long n4,
+                                          bool isInterrupt);
 INLINE void send_msg_6(int targetcore,
                        unsigned long n0,
                        unsigned long n1,
                        unsigned long n2,
                        unsigned long n3,
                        unsigned long n4,
-                       unsigned long n5);
-INLINE void send_msg_3_I(int targetcore,
-                         unsigned long n0,
-                         unsigned long n1,
-                         unsigned long n2);
+                       unsigned long n5,
+                                          bool isInterrupt);
 INLINE void cache_msg_1(int targetcore,
                         unsigned long n0);
 INLINE void cache_msg_2(int targetcore,
index 7ba29a8518b56a29423172f4f88347ca162471a2..b4a42b6d0e8c7b07b882a5fd18ce760c3dd12d78 100644 (file)
@@ -100,7 +100,7 @@ void initruntimedata() {
   outmsglast = 0;
   outmsgleft = 0;
   isMsgHanging = false;
-  isMsgSending = false;
+  //isMsgSending = false;
 
   smemflag = true;
   bamboo_cur_msp = NULL;
@@ -241,10 +241,10 @@ bool checkObjQueue() {
     while(!lockflag) {
       BAMBOO_WAITING_FOR_LOCK(0);
          // check for outgoing sends
-         if (isMsgHanging) {
+         /*if (isMsgHanging) {
                extern inline void send_hanging_msg(bool);
                send_hanging_msg(true);
-         } 
+         } */
     }             // while(!lockflag)
     grount = lockresult;
 #ifdef DEBUG
@@ -403,8 +403,8 @@ void checkCoreStatus() {
          for(i = 1; i < NUMCORESACTIVE; ++i) {
            corestatus[i] = 1;
            // send status confirm msg to core i
-           send_msg_1(i, STATUSCONFIRM);
-         }                               // for(i = 1; i < NUMCORESACTIVE; ++i)
+           send_msg_1(i, STATUSCONFIRM, false);
+         }   // for(i = 1; i < NUMCORESACTIVE; ++i)
          return;
        } else {
          // all the core status info are the latest
@@ -434,7 +434,7 @@ void checkCoreStatus() {
 #endif
          for(i = 1; i < NUMCORESACTIVE; ++i) {
            // send profile request msg to core i
-           send_msg_2(i, PROFILEOUTPUT, totalexetime);
+           send_msg_2(i, PROFILEOUTPUT, totalexetime, false);
          } // for(i = 1; i < NUMCORESACTIVE; ++i)
          // pour profiling data on startup core
          outputProfileData();
@@ -624,7 +624,7 @@ inline void run(void * arg) {
 #endif
              // send stall msg
              send_msg_4(STARTUPCORE, TRANSTALL, BAMBOO_NUM_OF_CORE,
-                        self_numsendobjs, self_numreceiveobjs);
+                        self_numsendobjs, self_numreceiveobjs, false);
              sendStall = true;
              isfirst = true;
              busystatus = false;
@@ -1572,7 +1572,10 @@ INLINE int checkMsgLength_I(int size) {
   default:
   {
     BAMBOO_DEBUGPRINT_REG(type);
+       BAMBOO_DEBUGPRINT_REG(size);
     BAMBOO_DEBUGPRINT_REG(msgdataindex);
+       BAMBOO_DEBUGPRINT_REG(msgdatalast);
+       BAMBOO_DEBUGPRINT_REG(msgdatafull);
     int i = 6;
     while(i-- > 0) {
       BAMBOO_DEBUGPRINT(msgdata[msgdataindex+i]);
@@ -1596,7 +1599,7 @@ INLINE int checkMsgLength_I(int size) {
 
 INLINE void processmsg_transobj_I() {
   MSG_INDEXINC_I();
-  struct transObjInfo * transObj = RUNMALLOC_I(sizeof(struct transObjInfo));
+  struct transObjInfo * transObj=RUNMALLOC_I(sizeof(struct transObjInfo));
   int k = 0;
 #ifdef DEBUG
 #ifndef CLOSE_PRINT
@@ -1622,7 +1625,7 @@ INLINE void processmsg_transobj_I() {
     //BAMBOO_DEBUGPRINT_REG(transObj->queues[2*k]);
 #endif
 #endif
-    transObj->queues[2*k+1] = msgdata[msgdataindex];             //[3+2*k+1];
+    transObj->queues[2*k+1] = msgdata[msgdataindex];        //[3+2*k+1];
     MSG_INDEXINC_I();
 #ifdef DEBUG
 #ifndef CLOSE_PRINT
@@ -1694,7 +1697,7 @@ INLINE void processmsg_lockrequest_I() {
   int data4 = msgdata[msgdataindex];       // request core
   MSG_INDEXINC_I();
   // -1: redirected, 0: approved, 1: denied
-  int deny = processlockrequest(locktype, data3, data2, data4, data4, true);
+  int deny=processlockrequest(locktype, data3, data2, data4, data4, true);
   if(deny == -1) {
     // this lock request is redirected
     return;
@@ -1702,11 +1705,11 @@ INLINE void processmsg_lockrequest_I() {
     // send response msg
     // for 32 bit machine, the size is always 4 words, cache the msg first
     int tmp = deny==1 ? LOCKDENY : LOCKGROUNT;
-    //if(isMsgSending) {
+    if(BAMBOO_CHECK_SEND_MODE()) {
     cache_msg_4(data4, tmp, locktype, data2, data3);
-    /*} else {
-            send_msg_4(data4, tmp, locktype, data2, data3);
-       }*/
+    } else {
+    send_msg_4(data4, tmp, locktype, data2, data3, true);
+    }
   }
 }
 
@@ -1802,13 +1805,13 @@ INLINE void processmsg_redirectlock_I() {
   } else {
     // send response msg
     // for 32 bit machine, the size is always 4 words, cache the msg first
-    //if(isMsgSending) {
+    if(BAMBOO_CHECK_SEND_MODE()) {
     cache_msg_4(data4, deny==1 ? REDIRECTDENY : REDIRECTGROUNT,
                 data1, data2, data3);
-    /*} else {
-            send_msg_4(data4, deny==1?REDIRECTDENY:REDIRECTGROUNT,
-                                                     data1, data2, data3);
-       }*/
+    } else {
+    send_msg_4(data4, deny==1?REDIRECTDENY:REDIRECTGROUNT,
+               data1, data2, data3, true);
+    }
   }
 }
 
@@ -1902,11 +1905,11 @@ INLINE void processmsg_profileoutput_I() {
   MSG_INDEXINC_I();
   outputProfileData();
   // cache the msg first
-  //if(isMsgSending) {
+  if(BAMBOO_CHECK_SEND_MODE()) {
   cache_msg_2(STARTUPCORE, PROFILEFINISH, BAMBOO_NUM_OF_CORE);
-  /*} else {
-          send_msg_2(STARTUPCORE, PROFILEFINISH, BAMBOO_NUM_OF_CORE);
-     }*/
+  } else {
+  send_msg_2(STARTUPCORE, PROFILEFINISH, BAMBOO_NUM_OF_CORE, true);
+  }
 }
 
 INLINE void processmsg_profilefinish_I() {
@@ -1941,15 +1944,15 @@ INLINE void processmsg_statusconfirm_I() {
 #endif
 #endif
     // cache the msg first
-    //if(isMsgSending) {
+    if(BAMBOO_CHECK_SEND_MODE()) {
     cache_msg_5(STARTUPCORE, STATUSREPORT,
                 busystatus ? 1 : 0, BAMBOO_NUM_OF_CORE,
                 self_numsendobjs, self_numreceiveobjs);
-    /*} else {
-            send_msg_5(STARTUPCORE, STATUSREPORT, busystatus?1:0,
-                                                     BAMBOO_NUM_OF_CORE, self_numsendobjs,
-                                                     self_numreceiveobjs);
-       }*/
+    } else {
+    send_msg_5(STARTUPCORE, STATUSREPORT, busystatus?1:0,
+               BAMBOO_NUM_OF_CORE, self_numsendobjs,
+               self_numreceiveobjs, true);
+    }
   }
 }
 
@@ -2028,22 +2031,22 @@ INLINE void processmsg_memrequest_I() {
       if(INITPHASE == gcphase) {
        // if still in the initphase of gc, send a startinit msg again,
        // cache the msg first
-       //if(isMsgSending) {
+       if(BAMBOO_CHECK_SEND_MODE()) {
        cache_msg_1(data2, GCSTARTINIT);
-       /*} else {
-               send_msg_1(data2, GCSTARTINIT);
-          }*/
+       } else {
+       send_msg_1(data2, GCSTARTINIT, true);
+       }
       }
     } else {
 #endif
     mem = smemalloc_I(data2, data1, &allocsize);
     if(mem != NULL) {
       // send the start_va to request core, cache the msg first
-      //if(isMsgSending) {
+      if(BAMBOO_CHECK_SEND_MODE()) {
       cache_msg_3(data2, MEMRESPONSE, mem, allocsize);
-      /*} else {
-              send_msg_3(data2, MEMRESPONSE, mem, allocsize);
-         }*/
+      } else {
+      send_msg_3(data2, MEMRESPONSE, mem, allocsize, true);
+      }
     } // if mem == NULL, the gcflag of the startup core has been set
     // and the gc should be started later, then a GCSTARTINIT msg
     // will be sent to the requesting core to notice it to start gc
@@ -2206,11 +2209,11 @@ INLINE void processmsg_gcfinishcompact_I() {
       int dstcore = 0;
       if(gcfindSpareMem_I(&startaddr, &tomove, &dstcore, data4, cnum)) {
        // cache the msg first
-       //if(isMsgSending) {
+       if(BAMBOO_CHECK_SEND_MODE()) {
        cache_msg_4(cnum, GCMOVESTART, dstcore, startaddr, tomove);
-       /*} else {
-                     send_msg_4(cnum, GCMOVESTART, dstcore, startaddr, tomove);
-             }*/
+       } else {
+       send_msg_4(cnum, GCMOVESTART, dstcore, startaddr, tomove, true);
+       }
       }
     } else {
       gccorestatus[cnum] = 0;
@@ -2243,15 +2246,15 @@ INLINE void processmsg_gcmarkconfirm_I() {
     BAMBOO_EXIT(0xb005);
   } else {
     // send response msg, cahce the msg first
-    //if(isMsgSending) {
+    if(BAMBOO_CHECK_SEND_MODE()) {
     cache_msg_5(STARTUPCORE, GCMARKREPORT, BAMBOO_NUM_OF_CORE,
                 gcbusystatus, gcself_numsendobjs,
                 gcself_numreceiveobjs);
-    /*} else {
-            send_msg_5(STARTUPCORE, GCMARKREPORT, BAMBOO_NUM_OF_CORE,
-                                                     gcbusystatus, gcself_numsendobjs,
-                                                     gcself_numreceiveobjs);
-       }*/
+    } else {
+    send_msg_5(STARTUPCORE, GCMARKREPORT, BAMBOO_NUM_OF_CORE,
+               gcbusystatus, gcself_numsendobjs,
+               gcself_numreceiveobjs, true);
+    }
   }
 }
 
@@ -2341,11 +2344,11 @@ INLINE void processmsg_gcmaprequest_I() {
        }*/
   } else {
     // send back the mapping info, cache the msg first
-    //if(isMsgSending) {
+    if(BAMBOO_CHECK_SEND_MODE()) {
     cache_msg_3(data2, GCMAPINFO, data1, (int)dstptr);
-    /*} else {
-            send_msg_3(data2, GCMAPINFO, data1, (int)dstptr);
-       }*/
+    } else {
+    send_msg_3(data2, GCMAPINFO, data1, (int)dstptr, true);
+    }
   }
 #ifdef GC_PROFILE
   flushstalltime_i += BAMBOO_GET_EXE_TIME()-ttimei;
@@ -2367,7 +2370,7 @@ INLINE void processmsg_gcmapinfo_I() {
 #endif
     BAMBOO_EXIT(0xb008);
   } else {
-    gcmappedobj = msgdata[msgdataindex];                     // [2]
+    gcmappedobj = msgdata[msgdataindex];  // [2]
     MSG_INDEXINC_I();
     //mgchashReplace_I(msgdata[1], msgdata[2]);
     //mgchashInsert_I(gcobj2map, gcmappedobj);
@@ -2451,7 +2454,7 @@ processmsg:
   if((size == 0) || (checkMsgLength_I(size) == -1)) {
     // not a whole msg
     // have new coming msg
-    if(BAMBOO_MSG_AVAIL() != 0) {
+    if((BAMBOO_MSG_AVAIL() != 0) && !msgdatafull) {
       goto msg;
     } else {
       return -1;
@@ -2685,11 +2688,12 @@ processmsg:
     default:
       break;
     }             // switch(type)
-                  //memset(msgdata, '\0', sizeof(int) * msgdataindex);
-                  //msgdataindex = 0;
+    //memset(msgdata, '\0', sizeof(int) * msgdataindex);
+    //msgdataindex = 0;
     msglength = BAMBOO_MSG_BUF_LENGTH;
     // TODO
     //printf("++ msg: %x \n", type);
+
     if(msgdataindex != msgdatalast) {
       // still have available msg
       goto processmsg;
@@ -2703,7 +2707,7 @@ processmsg:
     // have new coming msg
     if(BAMBOO_MSG_AVAIL() != 0) {
       goto msg;
-    }
+    } // TODO
 
 #ifdef PROFILE
 /*if(isInterrupt) {
@@ -2956,7 +2960,7 @@ void releasewritelock_r(void * lock, void * redirectlock) {
     // send lock release with redirect info msg
     // for 32 bit machine, the size is always 4 words
     send_msg_4(targetcore, REDIRECTRELEASE, 1, (int)lock,
-               (int)redirectlock);
+               (int)redirectlock, false);
   }
 }
 #endif
@@ -3074,19 +3078,19 @@ newtask:
       while(!lockflag) {
        BAMBOO_WAITING_FOR_LOCK(0);
        // check for outgoing sends
-    if (isMsgHanging) {
+    /*if (isMsgHanging) {
       extern inline void send_hanging_msg(bool);
       send_hanging_msg(true);
-    } 
+    } */
          }
 #ifndef INTERRUPT
       if(reside) {
        while(BAMBOO_WAITING_FOR_LOCK(0) != -1) {
          // check for outgoing sends
-         if (isMsgHanging) {
+         /*if (isMsgHanging) {
                extern inline void send_hanging_msg(bool);
                send_hanging_msg(true);
-         } 
+         } */
        }
       }
 #endif