From owner-freebsd-hackers Thu Jan 15 21:42:20 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id VAA28051 for hackers-outgoing; Thu, 15 Jan 1998 21:42:20 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from smtp03.primenet.com (smtp03.primenet.com [206.165.6.133]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id VAA28014 for ; Thu, 15 Jan 1998 21:42:02 -0800 (PST) (envelope-from tlambert@usr06.primenet.com) Received: (from daemon@localhost) by smtp03.primenet.com (8.8.8/8.8.8) id WAA27194; Thu, 15 Jan 1998 22:41:18 -0700 (MST) Received: from usr06.primenet.com(206.165.6.206) via SMTP by smtp03.primenet.com, id smtpd027168; Thu Jan 15 22:41:13 1998 Received: (from tlambert@localhost) by usr06.primenet.com (8.8.5/8.8.5) id WAA23329; Thu, 15 Jan 1998 22:41:11 -0700 (MST) From: Terry Lambert Message-Id: <199801160541.WAA23329@usr06.primenet.com> Subject: Re: Why no sys/setjmp.h? To: grog@lemis.com (Greg Lehey) Date: Fri, 16 Jan 1998 05:41:10 +0000 (GMT) Cc: tlambert@primenet.com, hackers@FreeBSD.ORG In-Reply-To: <19980116123904.45753@lemis.com> from "Greg Lehey" at Jan 16, 98 12:39:04 pm X-Mailer: ELM [version 2.4 PL25] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk > > In general, setjmp()/longjmp() prevent all sorts of optimizations > > from being used. > > In the kernel? In the compiler. No, I'm not saying the compiler knows about them, only that the programmer has to, and has to tell the compiler (via 'volatile') if -)2 or better is to work. Of course, it may be fixed in the most recent release.. we all know how goo ".0" releases are . 8-) 8-). > > Finally, the purpose of these functions is to allow the throwing of > > exceptions, and the kernel has it's own exception mechanisms. > > Which are? That was my question. Using tsleep()/wakeup(), for one. Any set of operations can be reduced. > > Technically, you could write your own setjmp/longjmp, use them, and > > if you were careful, not screw up. But it makes debugging and other > > tasks so difficult for so little gain (in an already difficult place, > > unless you have two machines and use a source debugger) that it's > > probably better to use a different approach. > > So what are kernel setjmp and longjmp there for? To make debugging and other tasks difficult. 8-). Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers.