[dpdk-dev] [PATCH v3] pflock: implementation of phase-fair reader writer locks

Honnappa Nagarahalli Honnappa.Nagarahalli at arm.com
Mon Mar 29 20:09:02 CEST 2021


<snip>

> >
> > > Subject: [PATCH v3] pflock: implementation of phase-fair reader
> > > writer locks
> > >
> > > This is a new type of reader-writer lock that provides better
> > > fairness guarantees which makes it better for typical DPDK applications.
> > > They lock internally uses two ticket pools, one for readers and one
> > > for
> >     ^^^^ The
> >
> > > writers.
> > >
> > > Phase fair reader writer locks ensure that neither reader or writer
> > > will be starved. Neither reader or writer are preferred, they
> > > execute in alternating phases. All operations of the same time
> > > (reader or writer) that try to acquire
> >                                                                   ^^^^
> > type
> >
> > > 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 at networkplumber.org>
> 
> Any more comments? Other than the typos in the commit log...
There are additional comments in the code (in librte_eal/include/generic/rte_pflock.h), you need to scroll down as the test code is on the top. I did not take a deeper look at the test code yet.


More information about the dev mailing list