lkml.org 
[lkml]   [1998]   [Jan]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: 2.2: TaskID's for CLONE_PID? Proper signal handling?
>From: Peeter Joot <peeter@joot.com>
>Date: Wed, 31 Dec 1997 12:57:06 -0500
Subject: Re: 2.2: TaskID's for CLONE_PID? Proper signal handling?

>> Well amongst the thread developers' documents, implementation of CLONE_PID is sited
>>as required for resolving the difference in LinuxThreads and the POSIX spec.
>>vis-`a-vis
>>(that's right...) signals. So...where might these discussions be taking place? On
>>this mailing list?

>There were some discussions on this list in the past, and on the linuxthreads
>list (linux-threads@magenet.com).

>Peeter

Having given it some thought, here's how I would like to see signals behave in a threaded process. Note it assumes use of CLONE_PID, so that the concept of a "process container" of N threads is possible.

Synchronous signals (e.g. SIGFPE, SIGILL, etc.) are sent to the thread that caused them.

Asynchronous signals (e.g. SIGINT, the real-time signals. etc.) are sent to an arbitrary thread that doesn't have the signal blocked. If all threads have the signal blocked, and a thread is executing sigwait (or sigwaitinfo), it is delivered via this
mechanism.

Directed signals (such as delivered by pthread_kill are delivered to the identified thread.

I believe this is per the POSIX spec. If the Linux community wanted to extend or allow modification of this behavior, it would seem something could be done using the flags in the sigaction structure.

In the programming environment which I worked in previously (LynxOS), this type of signal behavior made it easy to implement the main thread as the "signal handling thread" in a completely synchronous manner using sigwaitinfo. Thus, some applications could
have a signal handling thread, a GUI thread, and an "intense processing"" thread.

Since I'm already loaded to capacity w/ incoming mail, I'm not on the linux-threads list, so any responses from there, please direct directly to me (Steve.Suson@tuckerenergy.com).

Steve Suson
"Keep the faith."



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