Re: kernel thread support - LWP's

Steve Underwood (steveu@netpage.com.hk)
Fri, 16 Jul 1999 00:52:11 +0000


Larry McVoy wrote:

> : If you want to send a signal, you usually want to send it to a process,
> : not a particular thread.

> Nonsense. When I do
>
> $ cmd | cmd2 | cmd3
> and then hit ^C, I certainly do not want to kill one process, I want to
> kill all of them. There is this age old concept called process groups
> which makes this work. And process groups work just fine for killing a
> related group of cloned processes.
>
> : With the LWP model, there is a single PID,
> : shared by all the threads, making it easy to send the signal. Under
> : Linux, you have n PIDs for n threads. Which PID do you signal?
>
> This is just silly beyond words. The Linux model is _clearly_ the
> superset of the LWP model. Under Linux I can kill a specific thread
> or all of the threads, using the same interfaces Unix has had since v6
> or earlier. Under the LWP model, I can kill all the LWPs. I can't kill
> a specific one. And that's really a drag - maybe I want to use SIGUSR1
> or SIGHUP to turn on debugging on a per thread basis. Under Linux, that
> just works, with no new code to be written, no new commands to be added,
> no new model to be understood.

Yes, I fully agree. The Linux approach is far more sane and flexible. Signals
in the single PID model of threads are like using a sledge hammer to hit the
doorbell. However, POSIX threads seem to have been defined on the woolly
assumption that threads all lie within one PID, and specifies signal behaviour
that Linux doesn't comply with. To improve compatibility with dumb thread
systems that needs to be addressed, without loosing the current flexible
arrangements.

Steve

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