Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 12 Sep 2000 11:28:10 +0930
From:      Greg Lehey <grog@lemis.com>
To:        Chuck Paterson <cp@bsdi.com>
Cc:        Alfred Perlstein <bright@wintelcom.net>, arch@FreeBSD.ORG
Subject:   Re: Interruptable mutex aquires.
Message-ID:  <20000912112810.G88615@wantadilla.lemis.com>
In-Reply-To: <200009111815.MAA21525@berserker.bsdi.com>; from cp@bsdi.com on Mon, Sep 11, 2000 at 12:15:35PM -0600
References:  <200009111815.MAA21525@berserker.bsdi.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Monday, 11 September 2000 at 12:15:35 -0600, Chuck Paterson wrote:
> Alfred Perlstein wrote on: Sun, 10 Sep 2000 19:36:02 PDT
>>
>> There's a lot of code in the kernel that does this:
>>
>> while(lock != mine) {
>>	error = tsleep(&lock, PRIBIO, "foo", PCATCH);
>>	if (error)
>>		return(error);
>>>
>> lock = mine;
>>
>> Ok, well the equivelant way to do this with mutexes would be
>> to add a new function 'mtx_enter_interruptable()' [*]
>> that attempts to aquire a mutex but if interrupted returns
>> an error suitable for aborting the operation.
>
> 	In the followng the lock which is acquired is often held for
> long periods, including while an IO is in progress, where as mutexs
> don't want to be held across an io.

We discussed this in June, but I still don't understand what there is
in the nature of mutexes which makes it undesirable to hold them for
long times.  This seems to be more of a usage thing: the mutexes we
(and BSD/OS) currently have want to be released quickly.

Greg
--
Finger grog@lemis.com for PGP public key
See complete headers for address and phone numbers


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




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