From owner-freebsd-arch Mon Sep 11 11:15:46 2000 Delivered-To: freebsd-arch@freebsd.org Received: from berserker.bsdi.com (berserker.twistedbit.com [199.79.183.1]) by hub.freebsd.org (Postfix) with ESMTP id A99AA37B423 for ; Mon, 11 Sep 2000 11:15:43 -0700 (PDT) Received: from berserker.bsdi.com (cp@[127.0.0.1]) by berserker.bsdi.com (8.9.3/8.9.3) with ESMTP id MAA21525; Mon, 11 Sep 2000 12:15:35 -0600 (MDT) Message-Id: <200009111815.MAA21525@berserker.bsdi.com> To: Alfred Perlstein Cc: arch@freebsd.org Subject: Re: Interruptable mutex aquires. From: Chuck Paterson Date: Mon, 11 Sep 2000 12:15:35 -0600 Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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. Chuck 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. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message