Thread (27 messages) 27 messages, 5 authors, 2021-04-14

Re: [dpdk-dev] [PATCH v4] pflock: add phase-fair reader writer locks

From: Stephen Hemminger <stephen@networkplumber.org>
Date: 2021-03-30 05:14:48

On Mon, 29 Mar 2021 22:00:47 -0700
Stephen Hemminger [off-list ref] wrote:
This is a new type of reader-writer lock that provides better fairness
guarantees which better suited for typical DPDK applications.
A pflock has two ticket pools, one for readers and one
for writers.

Phase fair reader writer locks ensure that neither reader nor writer will be
starved. Neither reader or writer are preferred, they execute in
alternating phases. All operations of the same type (reader or writer)
that acquire the lock are handled in FIFO order.  Write
operations are exclusive, and multiple read operations can be run
together (until a write arrives).

A similar implementation is in Concurrency Kit package in FreeBSD.
For more information see:
   "Reader-Writer Synchronization for Shared-Memory Multiprocessor
    Real-Time Systems",
    http://www.cs.unc.edu/~anderson/papers/ecrts09b.pdf

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
v4 incorporates feedback, adds some comments and drops the trylock for now.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help