DPDK 22.11.6
|
Go to the source code of this file.
Data Structures | |
struct | rte_pflock |
Macros | |
#define | RTE_PFLOCK_INITIALIZER { } |
Functions | |
static __rte_experimental void | rte_pflock_init (struct rte_pflock *pf) |
static __rte_experimental void | rte_pflock_read_lock (rte_pflock_t *pf) |
static __rte_experimental void | rte_pflock_read_unlock (rte_pflock_t *pf) |
static __rte_experimental void | rte_pflock_write_lock (rte_pflock_t *pf) |
static __rte_experimental void | rte_pflock_write_unlock (rte_pflock_t *pf) |
Phase-fair locks
This file defines an API for phase-fair reader writer locks, which is a variant of typical reader-writer locks that prevent starvation. In this type of lock, readers and writers alternate. This significantly reduces the worst-case blocking for readers and writers.
This is an implementation derived from FreeBSD based on the work described in: Brandenburg, B. and Anderson, J. 2010. Spin-Based Reader-Writer Synchronization for Multiprocessor Real-Time Systems
All locks must be initialised before use, and only initialised once.
Definition in file rte_pflock.h.
#define RTE_PFLOCK_INITIALIZER { } |
A static pflock initializer.
Definition at line 79 of file rte_pflock.h.
|
inlinestatic |
Initialize the pflock to an unlocked state.
pf | A pointer to the pflock. |
Definition at line 92 of file rte_pflock.h.
|
inlinestatic |
Take a pflock for read.
pf | A pointer to a pflock structure. |
Definition at line 111 of file rte_pflock.h.
|
inlinestatic |
Release a pflock locked for reading.
pf | A pointer to the pflock structure. |
Definition at line 140 of file rte_pflock.h.
|
inlinestatic |
Take the pflock for write.
pf | A pointer to the pflock structure. |
Definition at line 156 of file rte_pflock.h.
|
inlinestatic |
Release a pflock held for writing.
pf | A pointer to a pflock structure. |
Definition at line 192 of file rte_pflock.h.