projects
/
cdsspec-compiler.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
ebdbbc6
)
save more
author
Peizhao Ou
<peizhaoo@uci.edu>
Tue, 25 Mar 2014 00:01:30 +0000
(17:01 -0700)
committer
Peizhao Ou
<peizhaoo@uci.edu>
Tue, 25 Mar 2014 00:01:30 +0000
(17:01 -0700)
benchmark/chase-lev-deque-bugfix/deque.c
patch
|
blob
|
history
benchmark/chase-lev-deque-bugfix/main.c
patch
|
blob
|
history
benchmark/cliffc-hashtable/.cliffc_hashtable.h.swp
[new file with mode: 0644]
patch
|
blob
benchmark/cliffc-hashtable/cliffc_hashtable.h
patch
|
blob
|
history
benchmark/cliffc-hashtable/main.cc
patch
|
blob
|
history
benchmark/mcs-lock/mcs-lock.cc
patch
|
blob
|
history
benchmark/mcs-lock/mcs-lock.h
patch
|
blob
|
history
benchmark/spsc-bugfix/queue.h
patch
|
blob
|
history
benchmark/spsc-bugfix/spsc-relacy.cc
patch
|
blob
|
history
diff --git
a/benchmark/chase-lev-deque-bugfix/deque.c
b/benchmark/chase-lev-deque-bugfix/deque.c
index 9fbc426101362b6787a9c45bf42f359246224f4b..11e5e9916e3da3b46fdd560e7ba1c309903109ba 100644
(file)
--- a/
benchmark/chase-lev-deque-bugfix/deque.c
+++ b/
benchmark/chase-lev-deque-bugfix/deque.c
@@
-82,7
+82,7
@@
void resize(Deque *q) {
}
/**** detected UL ****/
atomic_store_explicit(&q->array, new_a, memory_order_release);
}
/**** detected UL ****/
atomic_store_explicit(&q->array, new_a, memory_order_release);
- printf("resize\n");
+
//
printf("resize\n");
}
/**
}
/**
diff --git
a/benchmark/chase-lev-deque-bugfix/main.c
b/benchmark/chase-lev-deque-bugfix/main.c
index 1906f1d66e4cc31857ff34bcf3bb895b2f7abb81..786aa3c9e975a6b013886887b3d375a98ba68560 100644
(file)
--- a/
benchmark/chase-lev-deque-bugfix/main.c
+++ b/
benchmark/chase-lev-deque-bugfix/main.c
@@
-14,7
+14,7
@@
int b;
int c;
static void task(void * param) {
int c;
static void task(void * param) {
- a=steal(q);
+
//
a=steal(q);
a=steal(q);
}
a=steal(q);
}
@@
-34,7
+34,7
@@
int user_main(int argc, char **argv)
b=take(q);
c=take(q);
thrd_join(t);
b=take(q);
c=take(q);
thrd_join(t);
-
+/*
bool correct=true;
if (a!=1 && a!=2 && a!=4 && a!= EMPTY)
correct=false;
bool correct=true;
if (a!=1 && a!=2 && a!=4 && a!= EMPTY)
correct=false;
@@
-46,6
+46,7
@@
int user_main(int argc, char **argv)
correct=false;
if (!correct)
printf("a=%d b=%d c=%d\n",a,b,c);
correct=false;
if (!correct)
printf("a=%d b=%d c=%d\n",a,b,c);
+ */
//MODEL_ASSERT(correct);
return 0;
//MODEL_ASSERT(correct);
return 0;
diff --git a/benchmark/cliffc-hashtable/.cliffc_hashtable.h.swp
b/benchmark/cliffc-hashtable/.cliffc_hashtable.h.swp
new file mode 100644
(file)
index 0000000..
a868efd
Binary files /dev/null and b/benchmark/cliffc-hashtable/.cliffc_hashtable.h.swp differ
diff --git
a/benchmark/cliffc-hashtable/cliffc_hashtable.h
b/benchmark/cliffc-hashtable/cliffc_hashtable.h
index 1bbe1561f5d7a59e1c28e49b13f4518528c37fa7..5c32ca08ff9bdd9fd4a3a04d9cbb4fb99012f80d 100644
(file)
--- a/
benchmark/cliffc-hashtable/cliffc_hashtable.h
+++ b/
benchmark/cliffc-hashtable/cliffc_hashtable.h
@@
-221,7
+221,7
@@
friend class CHM;
}
kvs_data* resize(cliffc_hashtable *topmap, kvs_data *kvs) {
}
kvs_data* resize(cliffc_hashtable *topmap, kvs_data *kvs) {
- model_print("resizing...\n");
+
//
model_print("resizing...\n");
kvs_data *newkvs = _newkvs.load(memory_order_acquire);
if (newkvs != NULL)
return newkvs;
kvs_data *newkvs = _newkvs.load(memory_order_acquire);
if (newkvs != NULL)
return newkvs;
@@
-245,12
+245,12
@@
friend class CHM;
// Last check cause the 'new' below is expensive
newkvs = _newkvs.load(memory_order_acquire);
// Last check cause the 'new' below is expensive
newkvs = _newkvs.load(memory_order_acquire);
- model_print("hey1\n");
+
//
model_print("hey1\n");
if (newkvs != NULL) return newkvs;
newkvs = new kvs_data(newsz);
void *chm = (void*) new CHM(sz);
if (newkvs != NULL) return newkvs;
newkvs = new kvs_data(newsz);
void *chm = (void*) new CHM(sz);
- model_print("hey2\n");
+
//
model_print("hey2\n");
newkvs->_data[0].store(chm, memory_order_relaxed);
kvs_data *cur_newkvs;
newkvs->_data[0].store(chm, memory_order_relaxed);
kvs_data *cur_newkvs;
@@
-432,8
+432,8
@@
friend class CHM;
if (!passed) {
int old = _Old_Val == NULL ? 0 : _Old_Val->_val;
int ret = __RET__ == NULL ? 0 : __RET__->_val;
if (!passed) {
int old = _Old_Val == NULL ? 0 : _Old_Val->_val;
int ret = __RET__ == NULL ? 0 : __RET__->_val;
- model_print("Get: key: %d, _Old_Val: %d, RET: %d\n",
- key->_val, old, ret);
+
//
model_print("Get: key: %d, _Old_Val: %d, RET: %d\n",
+
//
key->_val, old, ret);
}
@Post_check:
//__RET__ == NULL ? true : equals_val(_Old_Val, __RET__)
}
@Post_check:
//__RET__ == NULL ? true : equals_val(_Old_Val, __RET__)
@@
-464,8
+464,8
@@
friend class CHM;
if (!passed) {
int old = _Old_Val == NULL ? 0 : _Old_Val->_val;
int ret = __RET__ == NULL ? 0 : __RET__->_val;
if (!passed) {
int old = _Old_Val == NULL ? 0 : _Old_Val->_val;
int ret = __RET__ == NULL ? 0 : __RET__->_val;
- model_print("Put: key: %d, val: %d, _Old_Val: %d, RET: %d\n",
- key->_val, val->_val, old, ret);
+
//
model_print("Put: key: %d, val: %d, _Old_Val: %d, RET: %d\n",
+
//
key->_val, val->_val, old, ret);
}
@Post_check:
equals_val(__RET__, _Old_Val)
}
@Post_check:
equals_val(__RET__, _Old_Val)
@@
-687,7
+687,7
@@
friend class CHM;
static inline bool CAS_val(kvs_data *kvs, int idx, void *expected, void
*desired) {
bool res = kvs->_data[2 * idx + 3].compare_exchange_strong(expected,
static inline bool CAS_val(kvs_data *kvs, int idx, void *expected, void
*desired) {
bool res = kvs->_data[2 * idx + 3].compare_exchange_strong(expected,
- desired, memory_order_
release
, memory_order_relaxed);
+ desired, memory_order_
acq_rel
, memory_order_relaxed);
/**
# If it is a successful put instead of a copy or any other internal
# operantions, expected != NULL
/**
# If it is a successful put instead of a copy or any other internal
# operantions, expected != NULL
@@
-720,7
+720,7
@@
friend class CHM;
if (K == NULL) {
if (K == NULL) {
- model_print("Key is null\n");
+
//
model_print("Key is null\n");
return NULL; // A miss
}
return NULL; // A miss
}
diff --git
a/benchmark/cliffc-hashtable/main.cc
b/benchmark/cliffc-hashtable/main.cc
index b6275ca63258434703ccd6d111aaf29299f9d387..3e527446dd267c9526c3959670e1a926dffb4f68 100644
(file)
--- a/
benchmark/cliffc-hashtable/main.cc
+++ b/
benchmark/cliffc-hashtable/main.cc
@@
-55,7
+55,8
@@
IntWrapper *k0, *k1, *k2, *k3, *k4, *k5;
IntWrapper *v0, *v1, *v2, *v3, *v4, *v5;
void threadA(void *arg) {
IntWrapper *v0, *v1, *v2, *v3, *v4, *v5;
void threadA(void *arg) {
- table->put(k1, v1);
+ table->put(k3, v3);
+ table->put(k1, v4);
//table->put(k2, v2);
//table->put(k3, v3);
/*
//table->put(k2, v2);
//table->put(k3, v3);
/*
@@
-69,14
+70,15
@@
void threadA(void *arg) {
}
void threadB(void *arg) {
}
void threadB(void *arg) {
- table->put(k1, v1);
- table->put(k2, v4);
- table->put(k3, v3);
+
//
table->put(k1, v1);
+
//
table->put(k2, v4);
+
//
table->put(k3, v3);
}
void threadMain(void *arg) {
val1 = table->get(k1);
}
void threadMain(void *arg) {
val1 = table->get(k1);
- val2 = table->get(k2);
+ //val2 = table->get(k2);
+ /*
if (val1 != NULL)
model_print("val1: %d\n", val1->_val);
else
if (val1 != NULL)
model_print("val1: %d\n", val1->_val);
else
@@
-84,7
+86,7
@@
void threadMain(void *arg) {
if (val2 != NULL)
model_print("val2: %d\n", val2->_val);
else
if (val2 != NULL)
model_print("val2: %d\n", val2->_val);
else
- model_print("val2: NULL\n");
+ model_print("val2: NULL\n");
*/
}
int user_main(int argc, char *argv[]) {
}
int user_main(int argc, char *argv[]) {
@@
-105,7
+107,7
@@
int user_main(int argc, char *argv[]) {
v0 = new IntWrapper(2048);
table->put(k1, v0);
table->put(k2, v0);
v0 = new IntWrapper(2048);
table->put(k1, v0);
table->put(k2, v0);
- model_print("hey\n");
+
//
model_print("hey\n");
thrd_create(&t1, threadA, NULL);
thrd_create(&t2, threadB, NULL);
threadMain(NULL);
thrd_create(&t1, threadA, NULL);
thrd_create(&t2, threadB, NULL);
threadMain(NULL);
diff --git
a/benchmark/mcs-lock/mcs-lock.cc
b/benchmark/mcs-lock/mcs-lock.cc
index d43689411a2855e3c1866177ab4393877303f8d7..0be129f2ae4b1e67897decfacbc9f565657cd900 100644
(file)
--- a/
benchmark/mcs-lock/mcs-lock.cc
+++ b/
benchmark/mcs-lock/mcs-lock.cc
@@
-17,18
+17,18
@@
void threadA(void *arg)
//shared = 17;
mutex->unlock(&g);
mutex->lock(&g);
//shared = 17;
mutex->unlock(&g);
mutex->lock(&g);
- printf("load: %u\n", load_32(&shared));
+
//
printf("load: %u\n", load_32(&shared));
//printf("load: %u\n", shared);
}
void threadB(void *arg)
{
mcs_mutex::guard g(mutex);
//printf("load: %u\n", shared);
}
void threadB(void *arg)
{
mcs_mutex::guard g(mutex);
- printf("load: %u\n", load_32(&shared));
+
//
printf("load: %u\n", load_32(&shared));
//printf("load: %u\n", shared);
mutex->unlock(&g);
mutex->lock(&g);
//printf("load: %u\n", shared);
mutex->unlock(&g);
mutex->lock(&g);
- printf("store: %d\n", 17);
+
//
printf("store: %d\n", 17);
//shared = 17;
store_32(&shared, 17);
}
//shared = 17;
store_32(&shared, 17);
}
diff --git
a/benchmark/mcs-lock/mcs-lock.h
b/benchmark/mcs-lock/mcs-lock.h
index a165437bf320388f52a934feb4c28ba51d6ca645..d9165d124a5a517ce3d38570d7c3bac387e65df8 100644
(file)
--- a/
benchmark/mcs-lock/mcs-lock.h
+++ b/
benchmark/mcs-lock/mcs-lock.h
@@
-94,9
+94,11
@@
public:
// unlock of pred can see me in the tail before I fill next
// publish me to previous lock-holder :
// unlock of pred can see me in the tail before I fill next
// publish me to previous lock-holder :
- // FIXME: detection miss, don't think it's necessary
+ // FIXME: detection miss, execution never ends
+ // If this is relaxed, the store 0 to gate will be read before and
+ // that lock will never ends.
pred->next.store(me, std::mo_release );
pred->next.store(me, std::mo_release );
- printf("lock_miss1\n");
+
//
printf("lock_miss1\n");
// (*2) pred not touched any more
// (*2) pred not touched any more
@@
-106,8
+108,8
@@
public:
int my_gate = 1;
while (my_gate ) {
my_gate = me->gate.load(std::mo_acquire);
int my_gate = 1;
while (my_gate ) {
my_gate = me->gate.load(std::mo_acquire);
- if (my_gate == 0)
- printf("lock at gate!\n");
+
//
if (my_gate == 0)
+
//
printf("lock at gate!\n");
/**
@Begin
@Commit_point_define_check: my_gate == 0
/**
@Begin
@Commit_point_define_check: my_gate == 0
@@
-133,9
+135,9
@@
public:
void unlock(guard * I) {
mcs_node * me = &(I->m_node);
void unlock(guard * I) {
mcs_node * me = &(I->m_node);
- // FIXME: detection miss,
don't think it's necessary
+ // FIXME: detection miss,
execution never ends
mcs_node * next = me->next.load(std::mo_acquire);
mcs_node * next = me->next.load(std::mo_acquire);
- printf("unlock_miss2\n");
+
//
printf("unlock_miss2\n");
if ( next == NULL )
{
mcs_node * tail_was_me = me;
if ( next == NULL )
{
mcs_node * tail_was_me = me;
@@
-157,9
+159,9
@@
public:
// (*1) catch the race :
rl::linear_backoff bo;
for(;;) {
// (*1) catch the race :
rl::linear_backoff bo;
for(;;) {
- // FIXME: detection miss,
don't think it's necessary
+ // FIXME: detection miss,
execution never ends
next = me->next.load(std::mo_acquire);
next = me->next.load(std::mo_acquire);
- printf("unlock_miss3\n");
+
//
printf("unlock_miss3\n");
if ( next != NULL )
break;
thrd_yield();
if ( next != NULL )
break;
thrd_yield();
diff --git
a/benchmark/spsc-bugfix/queue.h
b/benchmark/spsc-bugfix/queue.h
index b47452e5b61d0cc98bf1572524ce71f1189a7444..0a38e8fc555e5b1708fee434d8c044353dc7ce9e 100644
(file)
--- a/
benchmark/spsc-bugfix/queue.h
+++ b/
benchmark/spsc-bugfix/queue.h
@@
-41,7
+41,7
@@
public:
~spsc_queue()
{
~spsc_queue()
{
- RL_ASSERT(head == tail);
+
//
RL_ASSERT(head == tail);
delete ((node*)head($));
}
delete ((node*)head($));
}
diff --git
a/benchmark/spsc-bugfix/spsc-relacy.cc
b/benchmark/spsc-bugfix/spsc-relacy.cc
index 8d4ad3ba66c3793ed902c96c760d0c8f7c6ee51f..fc594fbef68e59f13057ea618f1f7ec30f1e8a33 100644
(file)
--- a/
benchmark/spsc-bugfix/spsc-relacy.cc
+++ b/
benchmark/spsc-bugfix/spsc-relacy.cc
@@
-15,7
+15,7
@@
struct spsc_queue_test : rl::test_suite<spsc_queue_test, 2>
else
{
int d = q.dequeue();
else
{
int d = q.dequeue();
- RL_ASSERT(11 == d);
+
//
RL_ASSERT(11 == d);
}
}
};
}
}
};