changes
authorbdemsky <bdemsky>
Tue, 19 Oct 2010 02:43:26 +0000 (02:43 +0000)
committerbdemsky <bdemsky>
Tue, 19 Oct 2010 02:43:26 +0000 (02:43 +0000)
Robust/src/Runtime/oooJava/hashStructure.c
Robust/src/Runtime/oooJava/hashStructure.h
Robust/src/Tests/rcr/test.java
Robust/src/buildscript

index 71348090ff6a8f00a2ac67eb642fbcf37791a6c2..872263b2fee6bcb7a8c6547434f0ddd410f0dc4d 100644 (file)
@@ -1,5 +1,5 @@
 #include "hashStructure.h"
-#include "WaitingQueue.h"
+//#include "WaitingQueue.h"
 #include "mlp_lock.h"
 #include "mem.h"
 
@@ -19,7 +19,7 @@ HashStructure* rcr_createHashtable(int sizeofWaitingQueue){
     newTable->array[i].tail=NULL;
   }
 
-  newTable->waitingQueue=mallocWaitingQueue(sizeofWaitingQueue);
+  //  newTable->waitingQueue=mallocWaitingQueue(sizeofWaitingQueue);
   return newTable;
 }
 
@@ -87,12 +87,14 @@ int rcr_WRITEBINCASE(HashStructure *T, void *ptr, int traverserID, SESEcommon *t
   if (bintail->type == WRITEBIN) {
     TraverserData * td = &(((WriteBinItem_rcr *)bintail)->val);
     //last one is to check for SESE blocks in a while loop.
-    if(unlikely(td->resumePtr == ptr) && td->traverserID == traverserID && td->task == task) {
-      return bintail->status;
+    if(unlikely(td->task == task)) {
+      be->head=val;
+      //return ready...this constraint is already handled
+      return READY;
     }
   } else if (bintail->type == READBIN) {
     TraverserData * td = &((ReadBinItem_rcr *)bintail)->array[((ReadBinItem_rcr *)bintail)->index - 1];
-    if(unlikely(td->resumePtr == ptr) && td->traverserID == traverserID) {
+    if(unlikely(td->task == task)) {
       //if it matches, then we remove it and the code below will upgrade it to a write.
       ((ReadBinItem_rcr *)bintail)->index--;
       bintail->total--;
@@ -239,15 +241,8 @@ void rcr_TAILWRITECASE(HashStructure *T, void *ptr, BinItem_rcr *val, BinItem_rc
 
 //TODO write deletion/removal methods
 
-/*
-RETIREHASHTABLE(MemoryQueue *q, REntry *r) {
-  Hashtable *T=r->hashtable;
-  BinItem_rcr *b=r->binitem;
-  RETIREBIN(T,r,b);
-}
-
-RETIREBIN(Hashtable *T, REntry *r, BinItem_rcr *b) {
-  int key=generateKey( OBJPTRPTR_2_OBJOID( r->pointer ) );
+RETIREHASHTABLE(HashStructure *T, SESECommon *task, int key) {
+  BinItem_rcr *b=T->array[key].head;
   if(isFineRead(r)) {
     atomic_dec(&b->total);
   }
@@ -258,6 +253,7 @@ RETIREBIN(Hashtable *T, REntry *r, BinItem_rcr *b) {
       val=(BinItem_rcr*)0x1;
       val=(BinItem_rcr*)LOCKXCHG((unsigned INTPTR*)&(T->array[key]->head), (unsigned INTPTR)val);
     } while(val==(BinItem_rcr*)0x1);
+
     // at this point have locked bin
     BinItem_rcr *ptr=val;
     int haveread=FALSE;
@@ -304,7 +300,7 @@ RETIREBIN(Hashtable *T, REntry *r, BinItem_rcr *b) {
     T->array[key]->head=val; // release lock
   }
 }
-*/
+
 
 /*
 //Int will return success/fail. -1 indicates error (i.e. there's nothing there).
index 67716af6edaa4670386648d3a62ba404a4bb1b86..1bcde9e7d33edbdf1ebf1985781cee92f0fe21b6 100644 (file)
@@ -2,7 +2,7 @@
 #define HASHSTRUCTURE_H_\r
 \r
 #include "mlp_runtime.h"\r
-#include "WaitingQueue.h"\r
+//#include "WaitingQueue.h"\r
 \r
 #define ITEM_NOT_AT_FRONT_OF_WAITINGQ 3\r
 #define TRAVERSER_FINISHED 2\r
@@ -26,7 +26,7 @@
 #define RNUMBINS 64\r
 #define RNUMREAD 64\r
 #define RNUMRENTRY 256\r
-#define RH_MASK (RNUMBINS<<4)-1\r
+#define RH_MASK (RNUMBINS)-1\r
 \r
 //Note: put resolved things at the end and unresolved at the front.\r
 typedef struct BinItem_rcr {\r
@@ -65,7 +65,7 @@ typedef struct BinElement_rcr {
 \r
 typedef struct Hashtable_rcr {\r
   BinElement_rcr array[RNUMBINS];\r
-  WaitingQueueBin * waitingQueue;\r
+  //  WaitingQueueBin * waitingQueue;\r
 } HashStructure;\r
 \r
 //Todo this is a clone of REntry, remove data fields as necessary\r
index 40e47edcd417042c84f4ed3da65e5419f82312ec..2f5ee3e028f09d04a0cbad2f4ddf68a0806fc5ac 100644 (file)
@@ -1,16 +1,23 @@
 public class test {
-  int x;
+  foo f;
   public test() {}
 
   public static void main(String x[]) {
     test r=new test();
+    r.f=new foo();
     int z;
     sese foo {
-      r.x=2;
+      r.f.x=2;
     }
     sese bar {
-      z=r.x;
+      z=r.f.x;
     }
     System.out.println(z);
   }
+}
+
+class foo {
+  foo() {
+  }
+  int x;
 }
\ No newline at end of file
index 26c0e8159680ff41ce183155276e70aff95a8ffa..a1b162f8de158062e547835a8a08023e60ea1a90 100755 (executable)
@@ -1214,7 +1214,7 @@ fi
 
 if $RCR
 then
-FILES="$FILES $tmpbuilddirectory/RuntimeConflictResolver.c $ROBUSTROOT/Runtime/oooJava/hashRCR.c $ROBUSTROOT/Runtime/oooJava/Queue_RCR.c $ROBUSTROOT/Runtime/oooJava/hashStructure.c $ROBUSTROOT/Runtime/oooJava/WaitingQueue.c $ROBUSTROOT/Runtime/oooJava/trqueue.c $ROBUSTROOT/Runtime/oooJava/rcr_runtime.c"
+FILES="$FILES $tmpbuilddirectory/RuntimeConflictResolver.c $ROBUSTROOT/Runtime/oooJava/hashRCR.c $ROBUSTROOT/Runtime/oooJava/Queue_RCR.c $ROBUSTROOT/Runtime/oooJava/hashStructure.c $ROBUSTROOT/Runtime/oooJava/trqueue.c $ROBUSTROOT/Runtime/oooJava/rcr_runtime.c"
 fi
 
 if $MLP_ON