rwlocks, correctness over speed.

Alfred Perlstein alfred at freebsd.org
Fri Nov 23 00:24:59 PST 2007


* dima <_pppp at mail.ru> [071122 19:20] wrote:
> 
> The current design is probably fast, but incorrect. Writers will be starved even if we deny recursive read-locks. There are 2 ways to fix that:
> 1. Forbid recursive read-locks *and* add a flag which would mean "a writer is waiting" (and prohibit future read-lock acquisition).

Yes, this would be done later.

> 2. Allow recursive read-locks, add the same flag, and add an accounting of all the current readers (so, only recursive read-lock acquisitions would be accepted if a writer is waiting).

Probably not going to happen as the extra bookkeeping is supposedly
cost prohibitive.

-Alfred


More information about the freebsd-arch mailing list