From: jzhou Date: Thu, 14 Oct 2010 22:16:44 +0000 (+0000) Subject: Add process of global thread queue in gc, not tested yet X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=f3d520989d3f844ca0907681075512c93dae11a3;p=IRC.git Add process of global thread queue in gc, not tested yet --- diff --git a/Robust/src/Runtime/bamboo/multicoregarbage.c b/Robust/src/Runtime/bamboo/multicoregarbage.c index 83967ec5..76dc4333 100644 --- a/Robust/src/Runtime/bamboo/multicoregarbage.c +++ b/Robust/src/Runtime/bamboo/multicoregarbage.c @@ -1159,6 +1159,21 @@ inline void tomark(struct garbagelist * stackptr) { } } + GC_BAMBOO_DEBUGPRINT(0xe509); +#ifdef MGC + // enqueue global thread queue + lockthreadqueue(); + unsigned int thread_counter = *((unsigned int*)(bamboo_thread_queue+1)); + if(thread_counter > 0) { + unsigned int start = *((unsigned int*)(bamboo_thread_queue+2)); + for(i = thread_counter; i > 0; i--) { + markObj((void *)bamboo_thread_queue[4+start]); + start = (start+1)&bamboo_max_thread_num_mask; + } + } + + GC_BAMBOO_DEBUGPRINT(0xe50a); +#endif } // void tomark(struct garbagelist * stackptr) inline void mark(bool isfirst, @@ -2264,6 +2279,20 @@ inline void flushRuntimeObj(struct garbagelist * stackptr) { } } +#ifdef MGC + // flush global thread queue + unsigned int thread_counter = *((unsigned int*)(bamboo_thread_queue+1)); + if(thread_counter > 0) { + unsigned int start = *((unsigned int*)(bamboo_thread_queue+2)); + for(i = thread_counter; i > 0; i--) { + bamboo_thread_queue[4+start] = + (INTPTR)(flushObj((void *)bamboo_thread_queue[4+start])); + start = (start+1)&bamboo_max_thread_num_mask; + } + } + + unlockthreadqueue(); +#endif } // void flushRuntimeObj(struct garbagelist * stackptr) inline void transmappinginfo() {