changes
authorPeizhao Ou <peizhaoo@uci.edu>
Sat, 21 Mar 2015 12:35:18 +0000 (05:35 -0700)
committerPeizhao Ou <peizhaoo@uci.edu>
Sat, 21 Mar 2015 12:35:18 +0000 (05:35 -0700)
concurrent-hashmap/Makefile
concurrent-hashmap/hashmap.h

index 89e5244b22dc7dfdafd062823ef34e595d88fe4a..645b54af410ea90918df3110cea58827200ad158 100644 (file)
@@ -5,7 +5,8 @@ NORMAL_TESTS := testcase1 testcase2 testcase3
 
 WILDCARD_TESTS := $(patsubst %, %_wildcard, $(NORMAL_TESTS))
 
 
 WILDCARD_TESTS := $(patsubst %, %_wildcard, $(NORMAL_TESTS))
 
-TESTS := $(NORMAL_TESTS) $(WILDCARD_TESTS)
+#TESTS := $(NORMAL_TESTS) $(WILDCARD_TESTS)
+TESTS := $(NORMAL_TESTS)
 
 all: $(TESTS)
 
 
 all: $(TESTS)
 
index 0d249251ec99dcaabbd10d301df8873a5f3a9cc1..68dd8154a146a35eac078aebed3da4cfddef909f 100644 (file)
@@ -5,17 +5,10 @@
 #include <atomic>
 #include "stdio.h" 
 //#include <common.h>
 #include <atomic>
 #include "stdio.h" 
 //#include <common.h>
-#ifdef STANDALONE
-#include <assert.h>
-#define MODEL_ASSERT assert 
-#else
-#include <model-assert.h>
-#endif
 #include <stdlib.h>
 #include <mutex>
 
 #include <stdlib.h>
 #include <mutex>
 
-#include "common.h"
-#include "sc_annotation.h"
+//#include "sc_annotation.h"
 
 #define relaxed memory_order_relaxed
 #define release memory_order_release
 
 #define relaxed memory_order_relaxed
 #define release memory_order_release
@@ -149,7 +142,7 @@ class HashMap {
        }
 
        Value* get(Key *key) {
        }
 
        Value* get(Key *key) {
-               MODEL_ASSERT (key);
+               //MODEL_ASSERT (key);
                int hash = hashKey(key);
 
                // Try first without locking...
                int hash = hashKey(key);
 
                // Try first without locking...
@@ -165,9 +158,9 @@ class HashMap {
                // lock, we ignore this operation for the SC analysis, and otherwise we
                // take it into consideration
                
                // lock, we ignore this operation for the SC analysis, and otherwise we
                // take it into consideration
                
-               SC_BEGIN();
+               //SC_BEGIN();
                Entry *firstPtr = first->load(acquire);
                Entry *firstPtr = first->load(acquire);
-               SC_END();
+               //SC_END();
 
                e = firstPtr;
                while (e != NULL) {
 
                e = firstPtr;
                while (e != NULL) {
@@ -209,7 +202,7 @@ class HashMap {
 
        Value* put(Key *key, Value *value) {
                // Don't allow NULL key or value
 
        Value* put(Key *key, Value *value) {
                // Don't allow NULL key or value
-               MODEL_ASSERT (key && value);
+               //MODEL_ASSERT (key && value);
 
                int hash = hashKey(key);
                Segment *seg = segments[hash & SEGMENT_MASK];
 
                int hash = hashKey(key);
                Segment *seg = segments[hash & SEGMENT_MASK];
@@ -248,7 +241,7 @@ class HashMap {
        }
 
        Value* remove(Key *key, Value *value) {
        }
 
        Value* remove(Key *key, Value *value) {
-               MODEL_ASSERT (key);
+               //MODEL_ASSERT (key);
                int hash = hashKey(key);
                Segment *seg = segments[hash & SEGMENT_MASK];
                atomic<Entry*> *tab;
                int hash = hashKey(key);
                Segment *seg = segments[hash & SEGMENT_MASK];
                atomic<Entry*> *tab;