Improvements in unbounded queue from gprof results---needs further testing

This commit is contained in:
Umar Farooq 2016-09-30 15:09:29 +02:00
parent 9516618923
commit 6742f969f8
3 changed files with 9 additions and 4 deletions

1
.gitignore vendored
View file

@ -8,3 +8,4 @@ spsc_ub_test_default
spsc_test_fib
mpmc_test
mpmc_test_fib
gmon.out

View file

@ -90,7 +90,8 @@ int spsc_ub_queue_push(struct spsc_ub_queue* q, void * v)
{
struct node* n = spsc_ub_alloc_node(q);
n->_next = NULL;
atomic_store_explicit(&(n->_next), NULL, memory_order_release);
//n->_next = NULL;
n->_value = v;
//store_release(&(q->_head->_next), n);

View file

@ -63,9 +63,12 @@ struct spsc_ub_queue
/* Producer part
* accessed only by producer */
struct node* _Atomic _head; /**> Head of the queue. */
struct node* _Atomic _first; /**> Last unused node (tail of node cache). */
struct node* _Atomic _tailcopy; /**> Helper which points somewhere between _first and _tail */
struct node* _head; /**> Head of the queue. */
cacheline_pad_t _pad2;
struct node* _first; /**> Last unused node (tail of node cache). */
cacheline_pad_t _pad3;
struct node* _tailcopy; /**> Helper which points somewhere between _first and _tail */
cacheline_pad_t _pad4;
};
/** Initialize SPSC queue */