[RFC] rwlock: prevent readers from starving writers

Stephen Hemminger stephen at networkplumber.org
Sat Jul 9 18:22:45 CEST 2022


On Sat, 9 Jul 2022 00:04:27 +0200
Morten Brørup <mb at smartsharesystems.com> wrote:

> > >  typedef struct {
> > > -	volatile int32_t cnt; /**< -1 when W lock held, > 0 when R locks  
> > held.  
> > > */
> > > +	volatile int32_t cnt;  
> 
> Not signed anymore, so consider uint32_t. Suggest also rename to cnt_state or similar, since it is not just a counter anymor

I tried that but the rte_wait_until is using signed value.


More information about the dev mailing list