From: jjenista Date: Wed, 3 Nov 2010 20:54:01 +0000 (+0000) Subject: when the RCR system resolves a parent stall site, the parent thread has its stallreco... X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=0930c4234af1335604c6dfb79a9f1e0dfa0efcea;p=IRC.git when the RCR system resolves a parent stall site, the parent thread has its stallrecord.common.rcrstatus set back to 0, but if the ooojava memory queue resolves the stall earlier, it allows the parent to resume without setting rcrstatus, so we added a line in the parent just after the stall so it clears its rcrstatus itself no matter which method resumes it --- diff --git a/Robust/src/IR/Flat/BuildCode.java b/Robust/src/IR/Flat/BuildCode.java index 566bf95c..f50be6d9 100644 --- a/Robust/src/IR/Flat/BuildCode.java +++ b/Robust/src/IR/Flat/BuildCode.java @@ -3309,8 +3309,17 @@ public class BuildCode { } if(state.RCR) { //no need to enqueue parent effect if coarse grained conflict clears us - output.println(" while(stallrecord.common.rcrstatus) ;"); - output.println(" BARRIER();"); + + + output.println(" while(stallrecord.common.rcrstatus) {;}"); + output.println(" BARRIER();"); + // was the code above actually meant to look like this? + //output.println(" while(stallrecord.common.rcrstatus) {"); + //output.println(" BARRIER();"); + //output.println(" sched_yield();"); + //output.println(" }"); + + output.println(" stallrecord.common.parentsStallSem=&runningSESEstallSem;"); output.println(" stallrecord.tag=rentry->tag;"); output.println(" stallrecord.___obj___=(struct ___Object___ *)"+generateTemp(fm, waitingElement.getTempDesc(), null)+";"); @@ -3323,7 +3332,13 @@ public class BuildCode { output.println(" stallrecord.common.rcrstatus=1;"); output.println(" enqueueTR(TRqueue, (void *)&stallrecord);"); } - output.println(" psem_take( &runningSESEstallSem, (struct garbagelist *)&___locals___ );"); + + output.println(" psem_take( &runningSESEstallSem, (struct garbagelist *)&___locals___ );"); + + if( state.RCR ) { + output.println(" stallrecord.common.rcrstatus=0;"); + } + if( state.COREPROF ) { output.println("#ifdef CP_EVENTID_TASKSTALLMEM"); output.println(" CP_LOGEVENT( CP_EVENTID_TASKSTALLMEM, CP_EVENTTYPE_END );"); @@ -4609,7 +4624,6 @@ public class BuildCode { output.println(" }"); - // eom // clean up its lock element from waiting queue, and decrement dependency count for next SESE block if((state.MLP && fsen != mlpa.getMainSESE()) || (state.OOOJAVA && fsen != oooa.getMainSESE())) {