Giovanni wrote:I didn't include a "kill" feature by design, it is inherently unsafe and there are a lot of corner cases.
I absolutely support this. It's just in my very special case that I can do something nasty like that, but it doesn't need to be be a general feature of the OS (and probably should not).
As for your concerns regarding the thread hierarchy:
Giovanni wrote:1) We are talking about threads here, not processes.
That's why I don't call it something powerful like "process management". The thread hierarchy would merely track the logical order of all threads in the system, but it does not specify what a user might do with that information. Personally, I need it for recursive termination, but that's just one use case of many.
Giovanni wrote:2) There would be a significant overhead as both code space and occupied RAM.
I cannot estimate code space yet but RAM would be three additional pointers (= 12 byte) per thread, which is not too bad imo.
Giovanni wrote:3)The feature would not be of common use, the overhead would be there always.
The feature can be optional (configurable via chconf.h) so there is no overhead at all if you disable it.
Giovanni wrote:4) There are other ways to accomplish the same thing: the one I proposed before and using the registry to scan threads and terminate them.
I don't see how the registry could help me here. Sure, I can use it to scan all threads, but the hierarchy information is still required, occupying additional memory. So instead of having both overheads - registry and hierarchy - I could drop the former and use the hierarchy information directly.
In fact, if we start to argue what can be accomplished with which method, POSIX would be the solution of choice, anyway. One of the very nice things about ChibiOS, however, is its fine-grained configurability. That said, registry and hierarchy are two different and independent optional features with distinct pros and cons.
I think I'll just implement the hierarchy and provide you a patch. Then you can decide if it should become part of the OS. Alternatively I can post the patch in the user projects section.
Of course there is still a third option, where I realize that my idea doesn't work out as expected and you have been right all the time ^^
- Thomas