On Tue, Jul 19, 2022 at 10:28 PM Stephen Hemminger
wrote:
>
> Modify reader/writer lock to avoid starvation of writer. The previous
> implementation would cause a writer to get starved if readers kept
> acquiring the lock. The new version uses an additional bit to indicate
> that a writer is wai
> From: Stephen Hemminger [mailto:step...@networkplumber.org]
> Sent: Wednesday, 20 July 2022 00.34
>
> > > /**
> > > @@ -179,7 +226,7 @@ rte_rwlock_write_lock(rte_rwlock_t *rwl)
> > > static inline void
> > > rte_rwlock_write_unlock(rte_rwlock_t *rwl)
> > > {
> > > - __atomic_store_n(&rwl->cn
> > /**
> > @@ -179,7 +226,7 @@ rte_rwlock_write_lock(rte_rwlock_t *rwl)
> > static inline void
> > rte_rwlock_write_unlock(rte_rwlock_t *rwl)
> > {
> > - __atomic_store_n(&rwl->cnt, 0, __ATOMIC_RELEASE);
> > + __atomic_fetch_sub(&rwl->cnt, RTE_RWLOCK_WRITE,
> > __ATOMIC_RELEASE);
>
>
> From: Stephen Hemminger [mailto:step...@networkplumber.org]
> Sent: Tuesday, 19 July 2022 22.28
>
> Modify reader/writer lock to avoid starvation of writer. The previous
> implementation would cause a writer to get starved if readers kept
> acquiring the lock. The new version uses an additiona
4 matches
Mail list logo