//need to add this
} else {
cFile.println(" record->rcrRecords["+index+"].count=RUNBIAS;\n");
+ cFile.println(" record->rcrRecords["+index+"].index=0;\n");
}
if(cSideDebug) {
//need to add this
} else {
cFile.println(" if(atomic_sub_and_test(RUNBIAS-totalcount,&(record->rcrRecords["+index+"].count))) {");
- cFile.println(" int flag=LOCKXCHG(&(record->rcrRecords["+index+"].flag),0);");
+ cFile.println(" int flag=LOCKXCHG32(&(record->rcrRecords["+index+"].flag),0);");
cFile.println(" if(flag) {");
//we have resolved a heap root...see if this was the last dependence
cFile.println(" if(atomic_sub_and_test(1, &(record->common.unresolvedDependencies))) workScheduleSubmit((void *)record);");
int allocSiteID = connectedHRHash.get(taint).getWaitingQueueBucketNum(node);
int traverserID = doneTaints.get(taint);
if (objConfRead)
- currCase.append(" int tmpvar=rcr_WTWRITEBINCASE(allHashStructures["+heaprootNum+"],"+prefix+", (SESEcommon *) record, "+index+");\n");
+ currCase.append(" int tmpvar"+depth+"=rcr_WTWRITEBINCASE(allHashStructures["+heaprootNum+"],"+prefix+", (SESEcommon *) record, "+index+");\n");
else
- currCase.append(" int tmpvar=rcr_WRITEBINCASE(allHashStructures["+heaprootNum+"],"+prefix+", (SESEcommon *) record, "+index+");\n");
+ currCase.append(" int tmpvar"+depth+"=rcr_WRITEBINCASE(allHashStructures["+heaprootNum+"],"+prefix+", (SESEcommon *) record, "+index+");\n");
} else if (primConfRead||objConfRead) {
int heaprootNum = connectedHRHash.get(taint).id;
assert heaprootNum != -1;
int allocSiteID = connectedHRHash.get(taint).getWaitingQueueBucketNum(node);
int traverserID = doneTaints.get(taint);
if (objConfRead)
- currCase.append(" int tmpvar=rcr_WTREADBINCASE(allHashStructures["+heaprootNum+"],"+prefix+", (SESEcommon *) record, "+index+");\n");
+ currCase.append(" int tmpvar"+depth+"=rcr_WTREADBINCASE(allHashStructures["+heaprootNum+"],"+prefix+", (SESEcommon *) record, "+index+");\n");
else
- currCase.append(" int tmpvar=rcr_READBINCASE(allHashStructures["+heaprootNum+"],"+prefix+", (SESEcommon *) record, "+index+");\n");
+ currCase.append(" int tmpvar"+depth+"=rcr_READBINCASE(allHashStructures["+heaprootNum+"],"+prefix+", (SESEcommon *) record, "+index+");\n");
}
- currCase.append("if (!(tmpvar&READYMASK)) totalcount--;\n");
- currCase.append("if (!(tmpvar&SPEC)) ; //add record\n");
-
- //Conflicts
+ if(primConfWrite||objConfWrite||primConfRead||objConfRead) {
+ currCase.append("if (!(tmpvar"+depth+"&READYMASK)) totalcount--;\n");
+ currCase.append("if (!(tmpvar"+depth+"&SPEC)) {\n");
+ currCase.append(" struct rcrRecord * rcrrec=&record->rcrRecords["+index+"];");
+ currCase.append(" rcrrec->array[rcrrec->index++];");
+ currCase.append("}\n");
+ }
//Array Case
if(node.isObjectArray() && node.decendantsConflict()) {
#include "mlp_lock.h"
#include "mem.h"
#include "classdefs.h"
+#include "rcr_runtime.h"
//NOTE: this is only temporary (for testing) and will be removed in favor of thread local variables
//It's basically an array of hashStructures so we can simulate what would happen in a many-threaded version
#define ISREADBIN(x) (!(x&BINMASK))
//#define POPCOUNT(x) __builtin_popcountll(x)
//__builtin_popcountll
-#define RESOLVE(x)
//NOTE: only temporary
if (ptr->status==NOTREADY) {
ReadBinItem_rcr* rptr=(ReadBinItem_rcr*)ptr;
for (i=0;i<rptr->index;i++) {
- TaskDescriptor * td=&rptr->array[i];
+ TraverserData * td=&rptr->array[i];
RESOLVE(td->task, td->bitindex);
if (((INTPTR)rptr->array[i].task)&PARENTBIN) {
//parents go immediately
void RESOLVE(SESEcommon *record, bitvt mask) {
int index=-1;
- struct rcrRecord * array=(struct rcrRecord *)(((char *)record)+record->common.offsetToParamRecords);
+ struct rcrRecord * array=(struct rcrRecord *)(((char *)record)+record->offsetToParamRecords);
while(mask!=0) {
int shift=__builtin_ctzll(mask)+1;
index+=shift;
if (atomic_sub_and_test(1,&array[index].count)) {
- inf flag=LOCKXCHG(&array[index].flag,0);
+ int flag=LOCKXCHG32(&array[index].flag,0);
if (flag) {
- if(atomic_sub_and_test(1, &(record->common.unresolvedDependencies)))
+ if(atomic_sub_and_test(1, &(record->unresolvedDependencies)))
workScheduleSubmit((void *)record);
}
}
//Method signatures are not in their final form since I have still not decided what is the optimum amount of data
//to store in each entry.
+void RESOLVE(SESEcommon *record, bitvt mask);
int rcr_WRITEBINCASE(HashStructure *T, void *ptr, SESEcommon *task, int index);
int rcr_READBINCASE(HashStructure *T, void *ptr, SESEcommon * task, int index);
int rcr_TAILREADCASE(HashStructure *T, void * ptr, BinItem_rcr *val, BinItem_rcr *bintail, int key, SESEcommon * task, int index);