From owner-freebsd-hackers Sat Jan 17 00:14:14 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id AAA13027 for hackers-outgoing; Sat, 17 Jan 1998 00:14:14 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from allegro.lemis.com (allegro.lemis.com [192.109.197.134]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id AAA12937 for ; Sat, 17 Jan 1998 00:13:26 -0800 (PST) (envelope-from grog@lemis.com) Received: from freebie.lemis.com (freebie.lemis.com [192.109.197.137]) by allegro.lemis.com (8.8.7/8.8.5) with ESMTP id SAA04416; Sat, 17 Jan 1998 18:17:04 +1030 (CST) Received: (from grog@localhost) by freebie.lemis.com (8.8.8/8.8.7) id SAA24774; Sat, 17 Jan 1998 18:17:03 +1030 (CST) (envelope-from grog) Message-ID: <19980117181703.04492@lemis.com> Date: Sat, 17 Jan 1998 18:17:03 +1030 From: Greg Lehey To: Terry Lambert Cc: hackers@FreeBSD.ORG Subject: Re: Why no sys/setjmp.h? References: <19980116164618.38842@lemis.com> <199801170717.AAA26333@usr01.primenet.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.84e In-Reply-To: <199801170717.AAA26333@usr01.primenet.com>; from Terry Lambert on Sat, Jan 17, 1998 at 07:17:52AM +0000 Organization: LEMIS, PO Box 460, Echunga SA 5153, Australia Phone: +61-8-8388-8286 Fax: +61-8-8388-8725 Mobile: +61-41-739-7062 WWW-Home-Page: http://www.lemis.com/~grog Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk On Sat, Jan 17, 1998 at 07:17:52AM +0000, Terry Lambert wrote: >>>> Which are? That was my question. >>> >>> Using tsleep()/wakeup(), for one. Any set of operations can be reduced. >> >> OK. I have a situation where I discover an error in the middle of a >> relatively complicated function. As Mike Smith pointed out, 'function' is a poor choice of words. I'm in the top half of a driver (in process context *only*), checking configuration information, which requires a number of nested function calls. It does not require communication with the bottom half of the driver. >> I can see two possibilities to solve it: >> >> 1. Return -1 or some such, and test every function call within this >> part of the code. A lot of code. >> 2. longjmp () out of the code. >> >> Could you explain how to use tsleep()/wakeup() to perform this >> function? > > Obtain intention mode locks before descending. Locks on what? Descending where? This is pure code. With the exception of having to read disk blocks at times, there is no interruption. Reading the disk blocks is not part of the problem, though it would cause the process to be scheduled. > If you have a possible conflict, then the intention mode lock wasn't > granted, and this situtation never arose. 8-). Which situation? > Oh, yeah, I forgot, "transitive colsure" is a bad phrase. 8-(. So is "quality Microsoft software". Greg