for(Iterator<Analysis.OoOJava.WaitingElement> wtit=weset.iterator();wtit.hasNext();) {
Analysis.OoOJava.WaitingElement waitingElement=wtit.next();
int queueID=waitingElement.getQueueID();
- if (queueID>queuetovar.size())
- queuetovar.setSize(queueID);
+ if (queueID>=queuetovar.size())
+ queuetovar.setSize(queueID+1);
Long l=queuetovar.get(queueID);
long val=(l!=null)?l.longValue():0;
val=val|(1<<queueID);
assert(waitingElement.getStatus()>=ConflictNode.COARSE);
long mask=queuetovar.get(queueID);
- output.println(" rentry=mlpCreateREntry(runningSESE->memoryQueueArray["+ waitingElement.getQueueID()+ "]," + waitingElement.getStatus() + ", &(seseToIssue->common)"+mask+"LL);");
+ output.println(" rentry=mlpCreateREntry(runningSESE->memoryQueueArray["+ waitingElement.getQueueID()+ "]," + waitingElement.getStatus() + ", &(seseToIssue->common), "+mask+"LL);");
output.println(" seseToIssue->common.rentryArray[seseToIssue->common.rentryIdx++]=rentry;");
output.println(" rentry->queue=runningSESE->memoryQueueArray[" + waitingElement.getQueueID()+"];");
return retval;
}
-void READBINCASE(Hashtable *T, REntry *r, BinItem *val, int key, int inc) {
+int READBINCASE(Hashtable *T, REntry *r, BinItem *val, int key, int inc) {
BinItem * bintail=T->array[key]->tail;
if (isReadBinItem(bintail)) {
return TAILREADCASE(T, r, val, bintail, key, inc);
T->array[key]->head=val;//released lock
}
-void ADDVECTOR(MemoryQueue *Q, REntry *r) {
+int ADDVECTOR(MemoryQueue *Q, REntry *r) {
if(!isVector(Q->tail)) {
//Fast Case
if (isParentCoarse(r) && Q->tail->total==0 && Q->tail==Q->head) {
//SCC's don't come in parent variety
-void ADDSCC(MemoryQueue *Q, REntry *r) {
+int ADDSCC(MemoryQueue *Q, REntry *r) {
//added SCC
SCC* S=createSCC();
S->item.total=1;
//need to update status
head->status=READY;
if (isHashtable(head)) {
- RESOLVEHASHTABLE(Q, head);
+ RESOLVEHASHTABLE(Q, (Hashtable *) head);
} else if (isVector(head)) {
- RESOLVEVECTOR(Q, head);
+ RESOLVEVECTOR(Q, (Vector *) head);
} else if (isSingleItem(head)) {
- RESOLVESCC(head);
+ RESOLVESCC((SCC *)head);
}
if (head->next==NULL)
break;
// parent write:3 coarse: 4, parent coarse:5, scc: 6
int type;
int tag;
- MemoryQueueItem *qitem;
+ struct MemoryQueueItem_t *qitem;
struct BinItem_t* binitem;
struct MemoryQueue_t* queue;
SESEcommon* seseRec;
#endif
MemoryQueue* createMemoryQueue();
void rehashMemoryQueue(SESEcommon* seseParent);
+void TAILWRITECASE(Hashtable *T, REntry *r, BinItem *val, BinItem *bintail, int key, int inc);
+void RETIRESCC(MemoryQueue *Q, REntry *r);
+void RETIREHASHTABLE(MemoryQueue *q, REntry *r);
+void RETIREBIN(Hashtable *T, REntry *r, BinItem *b);
+void RETIREVECTOR(MemoryQueue *Q, REntry *r);
+void RESOLVECHAIN(MemoryQueue *Q);
+void RESOLVEHASHTABLE(MemoryQueue *Q, Hashtable *T);
+void RESOLVEVECTOR(MemoryQueue *q, Vector *V);
+void RESOLVESCC(SCC *S);
+void resolveDependencies(REntry* rentry);
+
static inline void ADD_REFERENCE_TO( SESEcommon* seseRec ) {
atomic_inc( &(seseRec->refCount) );