ring: add optional yield to avoid spin forever
authorCunming Liang <cunming.liang@intel.com>
Tue, 17 Feb 2015 02:08:15 +0000 (10:08 +0800)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Tue, 24 Feb 2015 19:23:07 +0000 (20:23 +0100)
commit4e01799aeaeb84ff4cf8f516593bc8b1e0caac45
tree1727c81532173a066c17fde00917b0c8d90e9f56
parentb4bee5f66a72e435da04c7993bbe909846b50618
ring: add optional yield to avoid spin forever

Add a sched_yield() syscall if the thread spins for too long,
waiting other thread to finish its operations on the ring.
That gives pre-empted thread a chance to proceed and finish
with ring enqueue/dequeue operation.
The purpose is to reduce contention on the ring.
By ring_perf_test, it doesn't shows additional perf penalty.

Signed-off-by: Cunming Liang <cunming.liang@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
config/common_bsdapp
config/common_linuxapp
lib/librte_ring/rte_ring.h