From owner-freebsd-arch Mon Sep 11 18:59: 3 2000 Delivered-To: freebsd-arch@freebsd.org Received: from wantadilla.lemis.com (wantadilla.lemis.com [192.109.197.80]) by hub.freebsd.org (Postfix) with ESMTP id 2D95237B422 for ; Mon, 11 Sep 2000 18:59:00 -0700 (PDT) Received: (from grog@localhost) by wantadilla.lemis.com (8.11.0/8.9.3) id e8C1wAw97393; Tue, 12 Sep 2000 11:28:10 +0930 (CST) (envelope-from grog) Date: Tue, 12 Sep 2000 11:28:10 +0930 From: Greg Lehey To: Chuck Paterson Cc: Alfred Perlstein , arch@FreeBSD.ORG Subject: Re: Interruptable mutex aquires. Message-ID: <20000912112810.G88615@wantadilla.lemis.com> References: <200009111815.MAA21525@berserker.bsdi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i In-Reply-To: <200009111815.MAA21525@berserker.bsdi.com>; from cp@bsdi.com on Mon, Sep 11, 2000 at 12:15:35PM -0600 Organization: LEMIS, PO Box 460, Echunga SA 5153, Australia Phone: +61-8-8388-8286 Fax: +61-8-8388-8725 Mobile: +61-418-838-708 WWW-Home-Page: http://www.lemis.com/~grog X-PGP-Fingerprint: 6B 7B C3 8C 61 CD 54 AF 13 24 52 F8 6D A4 95 EF Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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