Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 16 Jan 1998 05:41:10 +0000 (GMT)
From:      Terry Lambert <tlambert@primenet.com>
To:        grog@lemis.com (Greg Lehey)
Cc:        tlambert@primenet.com, hackers@FreeBSD.ORG
Subject:   Re: Why no sys/setjmp.h?
Message-ID:  <199801160541.WAA23329@usr06.primenet.com>
In-Reply-To: <19980116123904.45753@lemis.com> from "Greg Lehey" at Jan 16, 98 12:39:04 pm

next in thread | previous in thread | raw e-mail | index | archive | help
> > 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.



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