[RFC] lib/st_ring: add single thread ring

Morten Brørup mb at smartsharesystems.com
Mon Aug 21 09:37:06 CEST 2023


> From: Honnappa Nagarahalli [mailto:honnappa.nagarahalli at arm.com]
> Sent: Monday, 21 August 2023 08.04
> 
> Add a single thread safe and multi-thread unsafe ring data structure.
> This library provides an simple and efficient alternative to multi-
> thread
> safe ring when multi-thread safety is not required.
> 
> Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli at arm.com>
> ---

Good idea.

However, I prefer it to be implemented in the ring lib as one more ring type. That would also give us a lot of the infrastructure (management functions, documentation and tests) for free.

The ring lib already has performance-optimized APIs for single-consumer and single-producer use, rte_ring_sc_dequeue_bulk() and rte_ring_sp_enqueue_burst(). Similar performance-optimized APIs for single-thread use could be added: rte_ring_st_dequeue_bulk() and rte_ring_st_enqueue_burst().

Regardless if added to the ring lib or as a separate lib, "reverse" APIs (for single-thread use only) and zero-copy APIs can be added at any time later.



More information about the dev mailing list