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:
2b614cd
)
injection result for deque
author
Peizhao Ou
<peizhaoo@uci.edu>
Fri, 21 Mar 2014 21:16:13 +0000
(14:16 -0700)
committer
Peizhao Ou
<peizhaoo@uci.edu>
Fri, 21 Mar 2014 21:16:13 +0000
(14:16 -0700)
benchmark/chase-lev-deque-bugfix/deque.c
patch
|
blob
|
history
diff --git
a/benchmark/chase-lev-deque-bugfix/deque.c
b/benchmark/chase-lev-deque-bugfix/deque.c
index e94da48abe8aeb92127052fff4b5a34f1d3cd8a4..1ebeb135c3cee5c456133794b2f83bcf1030419d 100644
(file)
--- a/
benchmark/chase-lev-deque-bugfix/deque.c
+++ b/
benchmark/chase-lev-deque-bugfix/deque.c
@@
-79,6
+79,7
@@
void resize(Deque *q) {
for(i=top; i < bottom; i++) {
atomic_store_explicit(&new_a->buffer[i % new_size], atomic_load_explicit(&a->buffer[i % size], memory_order_relaxed), memory_order_relaxed);
}
for(i=top; i < bottom; i++) {
atomic_store_explicit(&new_a->buffer[i % new_size], atomic_load_explicit(&a->buffer[i % size], memory_order_relaxed), memory_order_relaxed);
}
+ /**** FIXME: detected failure ****/
atomic_store_explicit(&q->array, new_a, memory_order_release);
printf("resize\n");
}
atomic_store_explicit(&q->array, new_a, memory_order_release);
printf("resize\n");
}
@@
-90,6
+91,7
@@
void resize(Deque *q) {
*/
void push(Deque *q, int x) {
size_t b = atomic_load_explicit(&q->bottom, memory_order_relaxed);
*/
void push(Deque *q, int x) {
size_t b = atomic_load_explicit(&q->bottom, memory_order_relaxed);
+ /**** FIXME: detected correctness ****/
size_t t = atomic_load_explicit(&q->top, memory_order_acquire);
Array *a = (Array *) atomic_load_explicit(&q->array, memory_order_relaxed);
if (b - t > atomic_load_explicit(&a->size, memory_order_relaxed) - 1) /* Full queue. */ {
size_t t = atomic_load_explicit(&q->top, memory_order_acquire);
Array *a = (Array *) atomic_load_explicit(&q->array, memory_order_relaxed);
if (b - t > atomic_load_explicit(&a->size, memory_order_relaxed) - 1) /* Full queue. */ {