Sorry if I was unclear. I'm specifically talking about non-POSIX
threading methods (normal C code though, not complicated JVMs).
Most uses of clone() that I've seen are not using any threading library
at all: some code that neads a helper thread calls clone(), and the
child does its own self-contained system calls (to avoid errno pollution).
It's conceptually fine that individual threads can die. _Conceptually_,
clone-by-hand threads are very similar to processes, and I have seen
this used in practice a few times.
And it all works fine: just use SIGCHLD and waitpid().
Now you have written this wonderful resource optimisation, which removes
zombies: CLONE_DETACHED. Unfortunately, catching invidual thread death
relies on the thread "exiting politely", as they say. So I still have
to use SIGCHLD and waitpid(), or a pipe(), for non-POSIX-model threads
that want to robustly detect "impolite" thread death.
I think that's an unfair penalty on non-POSIX-model threads.
-- JAmie
-
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/