logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

Author

       Generated automatically by Doxygen for DPDK from the source code.

DPDK                                             Version 24.11.2                                 rte_pflock.h(3)

Detailed Description

       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.

Function Documentation

staticvoidrte_pflock_init(structrte_pflock*pf)[inline],[static]
       Initialize the pflock to an unlocked state.

       Parameterspf A pointer to the pflock.

       Definition at line 88 of file rte_pflock.h.

   staticvoidrte_pflock_read_lock(rte_pflock_t*pf)[inline],[static]
       Take a pflock for read.

       Parameterspf A pointer to a pflock structure.

       Definition at line 103 of file rte_pflock.h.

   staticvoidrte_pflock_read_unlock(rte_pflock_t*pf)[inline],[static]
       Release a pflock locked for reading.

       Parameterspf A pointer to the pflock structure.

       Definition at line 127 of file rte_pflock.h.

   staticvoidrte_pflock_write_lock(rte_pflock_t*pf)[inline],[static]
       Take the pflock for write.

       Parameterspf A pointer to the pflock structure.

       Definition at line 139 of file rte_pflock.h.

   staticvoidrte_pflock_write_unlock(rte_pflock_t*pf)[inline],[static]
       Release a pflock held for writing.

       Parameterspf A pointer to a pflock structure.

       Definition at line 173 of file rte_pflock.h.

Macro Definition Documentation

#defineRTE_PFLOCK_INITIALIZER{}
       A static pflock initializer.

       Definition at line 79 of file rte_pflock.h.

Name

       rte_pflock.h

Synopsis

       #include <rte_common.h>
       #include <rte_pause.h>
       #include <rte_stdatomic.h>

   DataStructures
       struct rte_pflockMacros
       #define RTE_PFLOCK_INITIALIZER   {  }

   Functions
       static void rte_pflock_init (struct rte_pflock *pf)
       static void rte_pflock_read_lock (rte_pflock_t *pf)
       static void rte_pflock_read_unlock (rte_pflock_t *pf)
       static void rte_pflock_write_lock (rte_pflock_t *pf)
       static void rte_pflock_write_unlock (rte_pflock_t *pf)

See Also