ck_hp_{fifo, stack}: Get rid of backoff behavior by default.

ck_pring
Samy Al Bahra 13 years ago
parent 7dd549418a
commit 1cabea8a54

@ -28,7 +28,6 @@
#ifndef _CK_HP_FIFO_H #ifndef _CK_HP_FIFO_H
#define _CK_HP_FIFO_H #define _CK_HP_FIFO_H
#include <ck_backoff.h>
#include <ck_cc.h> #include <ck_cc.h>
#include <ck_hp.h> #include <ck_hp.h>
#include <ck_pr.h> #include <ck_pr.h>
@ -74,7 +73,6 @@ ck_hp_fifo_enqueue_mpmc(ck_hp_record_t *record,
void *value) void *value)
{ {
struct ck_hp_fifo_entry *tail, *next; struct ck_hp_fifo_entry *tail, *next;
ck_backoff_t backoff = CK_BACKOFF_INITIALIZER;
entry->value = value; entry->value = value;
entry->next = NULL; entry->next = NULL;
@ -93,8 +91,6 @@ ck_hp_fifo_enqueue_mpmc(ck_hp_record_t *record,
continue; continue;
} else if (ck_pr_cas_ptr(&fifo->tail->next, next, entry) == true) } else if (ck_pr_cas_ptr(&fifo->tail->next, next, entry) == true)
break; break;
ck_backoff_eb(&backoff);
} }
ck_pr_cas_ptr(&fifo->tail, tail, entry); ck_pr_cas_ptr(&fifo->tail, tail, entry);
@ -107,7 +103,6 @@ ck_hp_fifo_dequeue_mpmc(ck_hp_record_t *record,
void *value) void *value)
{ {
struct ck_hp_fifo_entry *head, *tail, *next; struct ck_hp_fifo_entry *head, *tail, *next;
ck_backoff_t backoff = CK_BACKOFF_INITIALIZER;
for (;;) { for (;;) {
tail = ck_pr_load_ptr(&fifo->tail); tail = ck_pr_load_ptr(&fifo->tail);
@ -132,8 +127,6 @@ ck_hp_fifo_dequeue_mpmc(ck_hp_record_t *record,
continue; continue;
} else if (ck_pr_cas_ptr(&fifo->head, head, next) == true) } else if (ck_pr_cas_ptr(&fifo->head, head, next) == true)
break; break;
ck_backoff_eb(&backoff);
} }
ck_pr_store_ptr(value, next->value); ck_pr_store_ptr(value, next->value);

@ -27,7 +27,6 @@
#ifndef _CK_HP_STACK_H #ifndef _CK_HP_STACK_H
#define _CK_HP_STACK_H #define _CK_HP_STACK_H
#include <ck_backoff.h>
#include <ck_cc.h> #include <ck_cc.h>
#include <ck_hp.h> #include <ck_hp.h>
#include <ck_pr.h> #include <ck_pr.h>
@ -49,7 +48,6 @@ CK_CC_INLINE static void *
ck_hp_stack_pop_mpmc(ck_hp_record_t *record, struct ck_stack *target) ck_hp_stack_pop_mpmc(ck_hp_record_t *record, struct ck_stack *target)
{ {
struct ck_stack_entry *entry, *update; struct ck_stack_entry *entry, *update;
ck_backoff_t backoff = CK_BACKOFF_INITIALIZER;
do { do {
entry = ck_pr_load_ptr(&target->head); entry = ck_pr_load_ptr(&target->head);
@ -75,8 +73,6 @@ ck_hp_stack_pop_mpmc(ck_hp_record_t *record, struct ck_stack *target)
if (update == NULL) if (update == NULL)
return (NULL); return (NULL);
} }
ck_backoff_eb(&backoff);
} }
return (entry); return (entry);

Loading…
Cancel
Save