Re:Hell is a multi-threaded C++ program (2006)
by shaklee3 on Saturday September 02, 2017 @06:40PM
(#15158607)
If you use dpdk it has some of the fastest (if not the fastest) ring implementation available.
[ Parent
| on HN ]
Re:Hell is a multi-threaded C++ program (2006)
by gardnr on Sunday September 03, 2017 @09:50PM
(#15165115)
In case anyone else is wondering a "ring" is a queue data structure which provides a different set of trade-offs. The documentation specifically compares it to a linked list:
The advantages of this data structure over a linked list queue are as follows:
* Faster; only requires a single Compare-And-Swap instruction of sizeof(void *) instead of several double-Compare-And-Swap instructions.
* Simpler than a full lockless queue.
* Adapted to bulk enqueue/dequeue operations. As pointers are stored in a table, a dequeue of several objects will not produce as many cache misses as in a linked queue. Also, a bulk dequeue of many objects does not cost more than a dequeue of a simple object.
The disadvantages:
* Size is fixed
* Having many rings costs more in terms of memory than a linked list queue. An empty ring contains at least N pointers.
http://dpdk.org/doc/guides/prog_guide/ring_lib.html