Re: Allow signaling a process by all its thread ids?

From: Chris Friesen
Date: Thu May 21 2009 - 19:11:47 EST


Alan Cox wrote:

> You need to show that
> - The current API breaks stuff
> - The current API is absolutely invalid in posix
> - Changing it improves the functionality and power of the kernel

I think an argument could be made for these. A task is not necessarily
a process, and kill() is only defined to send a signal to one or more
processes. This introduces potential problems if a) it is possible to
send a signal to an individual tid, and b) a tid can be reused in a
different process.

We already have the tgkill() syscall, which fixes the ambiguity by
specifying both the pid and tid. This is what pthread_kill() uses under
the hood. The fact that it was seen as necessary (back in 2.5)
indicates that there are problems with kill() as currently implemented.

> - Changing it doesn't break existing applications

This last one is the kicker. As I mentioned in my other reply, I
suspect that making such a change would break a lot of (not-quite-POSIX)
applications that assume they can send a signal to particular threads
using kill().

I see analogies to the whole fsync() issue.

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