int i;
int t = get_thread_num();
for (i = 0; i < MAX_FREELIST; i++) {
- unsigned int node = load_32(&free_lists[t][i]);
- //unsigned int node = free_lists[t][i];
+ //unsigned int node = load_32(&free_lists[t][i]);
+ unsigned int node = free_lists[t][i];
if (node) {
- store_32(&free_lists[t][i], 0);
- //free_lists[t][i] = 0;
+ //store_32(&free_lists[t][i], 0);
+ free_lists[t][i] = 0;
return node;
}
}
for (i = 0; i < MAX_FREELIST; i++) {
/* Should never race with our own thread here */
- unsigned int idx = load_32(&free_lists[t][i]);
- //unsigned int idx = free_lists[t][i];
+ //unsigned int idx = load_32(&free_lists[t][i]);
+ unsigned int idx = free_lists[t][i];
/* Found empty spot in free list */
if (idx == 0) {
- store_32(&free_lists[t][i], node);
- //free_lists[t][i] = node;
+ //store_32(&free_lists[t][i], node);
+ free_lists[t][i] = node;
return;
}
}
pointer tmp;
node = new_node();
- store_32(&q->nodes[node].value, val);
- //q->nodes[node].value = val;
+ //store_32(&q->nodes[node].value, val);
+ q->nodes[node].value = val;
tmp = atomic_load_explicit(&q->nodes[node].next, relaxed);
set_ptr(&tmp, 0); // NULL
atomic_store_explicit(&q->nodes[node].next, tmp, relaxed);
@End
*/
- /****FIXME: miss ****/
+ /**** Detected UL/DR (testcase1.c) ****/
next = atomic_load_explicit(&q->nodes[get_ptr(head)].next, acquire);
/**
@Begin
*/
return false; // NULL
}
- /****FIXME: miss (not reached) ****/
+ /**** Detected UL (testcase1.c) ****/
// Second release can be just relaxed
bool succ = false;
succ = atomic_compare_exchange_strong_explicit(&q->tail,
//printf("miss4_dequeue\n");
thrd_yield();
} else {
- value = load_32(&q->nodes[get_ptr(next)].value);
- //value = q->nodes[get_ptr(next)].value;
+ //value = load_32(&q->nodes[get_ptr(next)].value);
+ value = q->nodes[get_ptr(next)].value;
/****FIXME: correctness error ****/
success = atomic_compare_exchange_strong_explicit(&q->head,
&head,