Re: [RFC] [PATCH] C exceptions in kernel

From: Felix von Leitner (usenet-20020223@fefe.de)
Date: Sat Feb 23 2002 - 10:13:21 EST


Thus spake Dan Aloni (da-x@gmx.net):
> The attached patch implements C exceptions in the kernel, which *don't*
> depend on special support from the compiler. This is a 'request for
> comments'. The patch is very initial, should not be applied.

First of all: setjmp/longjmp is quite inefficient.

But my real problem with this is that the point about exceptions in C++
is the automatic stack unwinding. You use local variables and if an
exception is thrown, they automatically self-destruct. In particular,
you could implement spin locks as a class, and an exception will release
the lock automatically. Since this is not there in C, this is no more
elegant than using explicit goto.

Also, it makes understanding the code (and correlating assembly output
with C code) less easy, because you also have to look at that exception
implementation.

Felix
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Feb 23 2002 - 21:00:50 EST