kern/99979: Get Ready for Kernel Module in C++

Attilio Rao attilio at freebsd.org
Wed Jul 12 18:43:55 UTC 2006


2006/7/12, Joerg Sonnenberger <joerg at britannica.bec.de>:
> On Tue, Jul 11, 2006 at 11:37:52PM +0200, Attilio Rao wrote:
> > Even if I have no proof-of-concepts (so maybe somebody can show that
> > this is not fair), if we have setjmp/longjmp in the kernel we can have
> > a correct exception handling mechanism without not great problems.
>
> ROFL. Sorry, but using setjmp/longjmp is one of the worst possible
> implementation of exceptions since it is very expensive for the hot
> path, where you don't expect exceptions. They are called "exception" for
> a reason.

Well, this is not what I meant.
As exceptions are performed through stack unrolling (which is the
basic mechanism of setjmp/longjmp) it might not be impossible to
implement the correct try/catch mechanism in a correct way (even in
freestanding).
That's all.
No reference to how to do it :)

Attilio


-- 
Peace can only be achieved by understanding - A. Einstein


More information about the freebsd-hackers mailing list