[lkml]   [1996]   [Aug]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: proc fs and shared pids

That's just not the right model for threads, IMO. You want a
group of threads to appear as a single process, with a single PID. That
way other programs don't need to worry about whether a 'program' has
threads or doesn't.

There are already rules for what happens when you send a signal
to a process that includes more than on thread, and they allow the author
of the threaded program to control which threads handle which errors.

The short version of how it should be, IMO:

1) Synchronous signals like SIGFPE and SIGSEGV go to the thread
that caused them. If sent to the process, they are ignored if the last
'signal' command said to ignore them. Otherwise they go to a signal
handler (if one's installed). Otherwise they terminate all threads.

2) Asynchronous fatal signals (SIGTERM, SIGKILL) terminate the
group of threads unless it's a blockable signal (not KILL or STOP) and is
blocked. If a thread installed a signal handler and the signal is not
unblockable, the handler is called by the thread that installed it.


On Wed, 31 Jul 1996, Lex Spoon wrote:

> Allowing threads to share pid's means we have to go through and rethink
> what a lot of things mean. Do kill() and waitpid() operate on just
> one thread or all of them? People are going to sometimes want each
> of these cases, so we have to expand kill() and waitpid() to deal
> with it.
> Unix already has a way of dealing with a group of cooperating processes:
> process groups. Why not just use this concept for threads, too? If you
> want to kill all the threads in certain process group 37, you do
> kill(-37, SIGWHATEVER).
> I CAN see possible uses for wanting to address a "group of threads
> sharing the same memory mappings". But most often, aren't processes and
> process groups just what most people want?

 \ /
  Last update: 2005-03-22 13:37    [W:0.100 / U:2.860 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site