How priority propagation works on read/write lock?

rookie asmrookie at gmail.com
Wed Jan 18 08:31:25 PST 2006


2006/1/18, Daniel Eischen <deischen at freebsd.org>:
> I assume we already know how to propagate priority for mutexes, so
> once you know how to propagate for RWlocks, it all just works.
As I can see, propagate priority for mutex needs a little modify to
turnstiles code, that's not a great deal.

> Yes, once you choose a thread to propagate, you have to keep
> propagating through whatever it is blocked on or until you
> reach a point where the propagated priority is <= the priority
> of the next thread in the heirarchy.  I never questioned that
> part of it, just the need to do it for all threads owning the
> RW lock at the same time.
Maybe it's not "strictly" necessary but please consider that "blocking
hierarchies" are never too long and a total priority propagation would be
quicker (you however need to propagate to every owner in the end so doing it
at the same time could craft a bottleneck if the hierarchy is too long, but
it's a rare case and in the opposite way you need to rule 'what thread needs
to be update' every time a blocking thread is unblocked).

Cheers,
Attilio

--
Peace can only be achieved by understanding - A. Einstein


More information about the freebsd-hackers mailing list