Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 15 Mar 2003 01:12:44 -0800
From:      David Schultz <das@FreeBSD.ORG>
To:        David Xu <davidxu@FreeBSD.ORG>
Cc:        John Baldwin <jhb@FreeBSD.ORG>, cvs-all@FreeBSD.ORG, cvs-src@FreeBSD.ORG, src-committers@FreeBSD.ORG
Subject:   Re: cvs commit: src/lib/libpthread/thread thr_rwlock.c
Message-ID:  <20030315091244.GB25766@HAL9000.homeunix.com>
In-Reply-To: <200303150347.h2F3lLjK069888@freefall.freebsd.org>
References:  <200303150347.h2F3lLjK069888@freefall.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Thus spake David Xu <davidxu@FreeBSD.org>:
> This design prevents a thread to get a reader lock recursively when
> there is a writter blocked on a rwlock.

You're right in that the standard blesses the practice of a reader
recursing on a lock.  Glancing briefly at the code, it looks like
we presently deadlock if a writer is waiting.  However, the fix is
not so trivial.  Writers *must* be given priority over readers
within a bounded amount of time or they will be starved.  Consider
what happens when you have a neverending stream of readers.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030315091244.GB25766>