X-Git-Url: http://plrg.eecs.uci.edu/git/?p=cdsspec-compiler.git;a=blobdiff_plain;f=benchmark%2Fconcurrent-hashmap%2Fhashmap.h;h=99973e3cedc0cefcd007fdd6abcf80d4188472ff;hp=904d0b84e9233ce79246c404eec439eb86ebe62e;hb=7537757f9cbddcfa61076053bea0bddad28e37ad;hpb=fc0b24243f667dc9938d081305aa66dac66dc6ed;ds=sidebyside diff --git a/benchmark/concurrent-hashmap/hashmap.h b/benchmark/concurrent-hashmap/hashmap.h index 904d0b8..99973e3 100644 --- a/benchmark/concurrent-hashmap/hashmap.h +++ b/benchmark/concurrent-hashmap/hashmap.h @@ -130,7 +130,7 @@ class HashMap { /** @Begin @Interface: Get - @Commit_point_set: GetReadValue1 | GetReadEntry | GetReadValue2 + @Commit_point_set: GetReadValue1 | GetReadValue2 | GetReadNothing @ID: __RET__ @Action: int res = getIntegerMap(__map, key); @@ -156,13 +156,13 @@ class HashMap { // lock, we ignore this operation for the SC analysis, and otherwise we // take it into consideration - /**** UL ****/ + /**** UL (main.cc) ****/ Entry *firstPtr = first->load(acquire); e = firstPtr; while (e != NULL) { if (key, e->key) { - /**** inadmissible ****/ + /**** inadmissible (testcase1.cc) ****/ res = e->value.load(seq_cst); /** @Begin @@ -187,12 +187,6 @@ class HashMap { // Synchronized by locking, no need to be load acquire Entry *newFirstPtr = first->load(relaxed); - /** - @Begin - @Commit_point_define_check: true - @Label: GetReadEntry - @End - */ if (e != NULL || firstPtr != newFirstPtr) { e = newFirstPtr; while (e != NULL) { @@ -213,6 +207,12 @@ class HashMap { } } seg->unlock(); // Critical region ends + /** + @Begin + @Commit_point_define_check: true + @Label: GetReadNothing + @End + */ return 0; } @@ -249,7 +249,7 @@ class HashMap { // with the previous put()), no need to be acquire oldValue = e->value.load(relaxed); - /**** inadmissible ****/ + /**** inadmissible (testcase1.cc) ****/ e->value.store(value, seq_cst); /** @Begin @@ -267,9 +267,16 @@ class HashMap { // Add to front of list Entry *newEntry = new Entry(hash, key, value, firstPtr); - /**** UL ****/ + /**** UL (main.cc) ****/ // Publish the newEntry to others first->store(newEntry, release); + /** + @Begin + @Commit_point_clear: true + @Label: PutClear + @End + */ + /** @Begin @Commit_point_define_check: true