bug fixes
authorbdemsky <bdemsky>
Tue, 28 Jun 2011 09:16:54 +0000 (09:16 +0000)
committerbdemsky <bdemsky>
Tue, 28 Jun 2011 09:16:54 +0000 (09:16 +0000)
Robust/src/Runtime/bamboo/multicoregcmark.c
Robust/src/Runtime/bamboo/multicoremsg.c

index 0c9aa7914c2a76316dd0ecdf28427c2a07a87f3a..b2afaaad612055523a48b90a23bcef403f9b8df0 100644 (file)
@@ -267,21 +267,28 @@ void mark(struct garbagelist * stackptr) {
       // scan the pointers in object
       scanPtrsInObj(ptr, type);
     }
-    gc_status_info.gcbusystatus = false;
-    // send mark finish msg to core coordinator
-    if(STARTUPCORE == BAMBOO_NUM_OF_CORE) {
-      int entry_index = waitconfirm ? (gcnumsrobjs_index==0) : gcnumsrobjs_index;
-      gccorestatus[BAMBOO_NUM_OF_CORE] = 0;
-      gcnumsendobjs[entry_index][BAMBOO_NUM_OF_CORE]=gcself_numsendobjs;
-      gcnumreceiveobjs[entry_index][BAMBOO_NUM_OF_CORE]=gcself_numreceiveobjs;
-    } else {
-      if(!sendStall) {
-        send_msg_4(STARTUPCORE,GCFINISHMARK,BAMBOO_NUM_OF_CORE,gcself_numsendobjs,gcself_numreceiveobjs);
-        sendStall = true;
+
+    BAMBOO_ENTER_RUNTIME_MODE_FROM_CLIENT();
+    //make sure the queue is still empty...now we have interrupts off, things can't change on us...
+
+    if (!gc_moreItems_I()) {
+      gc_status_info.gcbusystatus = false;
+      // send mark finish msg to core coordinator
+      if(STARTUPCORE == BAMBOO_NUM_OF_CORE) {
+       int entry_index = waitconfirm ? (gcnumsrobjs_index==0) : gcnumsrobjs_index;
+       gccorestatus[BAMBOO_NUM_OF_CORE] = 0;
+       gcnumsendobjs[entry_index][BAMBOO_NUM_OF_CORE]=gcself_numsendobjs;
+       gcnumreceiveobjs[entry_index][BAMBOO_NUM_OF_CORE]=gcself_numreceiveobjs;
+       BAMBOO_ENTER_CLIENT_MODE_FROM_RUNTIME();
+       checkMarkStatus();
+      } else {
+       if(!sendStall) {
+         send_msg_4(STARTUPCORE,GCFINISHMARK,BAMBOO_NUM_OF_CORE,gcself_numsendobjs,gcself_numreceiveobjs);
+         sendStall = true;
+       }
+       BAMBOO_ENTER_CLIENT_MODE_FROM_RUNTIME();
       }
     }
-    if(BAMBOO_NUM_OF_CORE == STARTUPCORE)
-      checkMarkStatus();
   }
 } 
 
index a8464edb4a6449c7ffb683469b4cfe070911e60c..b17828c622e91d79f7accbc3dfa9f53f100c9c43 100644 (file)
@@ -578,7 +578,6 @@ INLINE void processmsg_gcfinish_I() {
 
 INLINE void processmsg_gcmarkconfirm_I() {
   BAMBOO_ASSERT(((BAMBOO_NUM_OF_CORE!=STARTUPCORE)&&(BAMBOO_NUM_OF_CORE<=NUMCORESACTIVE-1)));
-  gc_status_info.gcbusystatus = gc_moreItems_I();
   // send response msg, cahce the msg first
   if(BAMBOO_CHECK_SEND_MODE()) {
     cache_msg_5_I(STARTUPCORE,GCMARKREPORT,BAMBOO_NUM_OF_CORE,gc_status_info.gcbusystatus,gcself_numsendobjs,gcself_numreceiveobjs);