lkml.org 
[lkml]   [2000]   [Sep]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: thread group comments
Date
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2788.0">
<TITLE></TITLE>
</HEAD>
<BODY>

<P><FONT FACE="Times New Roman">I find I have to comment... although I haven't had access to my Linux box for a while (Real Life is taking too much of my time ;-)<BR>
<BR>
I, for one, am _not_ in favor of the tgid approach. I believe it is _far_ too complex a solution.<BR>
And, yes, I do have a better (IMNSHO) approach. I just didn't get enough time to code it. It feels _really_ rude to counter code with words. Oh well.<BR>
<BR>
What I believe should be done is just a few (simple) extensions to prctl.<BR>
Specifically, what we need is<BR>
* prctl(SEND_ME_PARENT_SIGNAL_x, s) --- tells kernel 'if my parent gets signal x, send me signal s' (signals will be queued atomically). This way, a thread can ask the kernel to be killed / stopped together with its parent.<BR>
* prctl(SIGNAL_ON_PARENT_EXEC, s) --- when parent _successfully_ exec's, send me signal s.</FONT>
<BR>

<BR><FONT FACE="Times New Roman">And that is _all_. No tgid mess, no specific handling of specific signals in the kernel, no 'all threads are blocking this signal' mess, no nada.<BR>
<BR>
Now, userspace will be a different story. There, we'll need the following:<BR>
- When process does pthreads_init, it creates a new thread (N+1 model); control returns via the _new_ thread (a la userspace thread-switch), and original thread (which has the original pid) remains as master in a special routine.<BR>
- Whenever a signal is handled _anywhere_ in the process, the master thread sets a handler for it. It's the master thread's job to distribute signals; also, when signal is blocked, it remains on master's queue. (If CLONE_SIGNAL lets thread do the sigaction setup by itself--- even better, less ITC :-)<BR>
- New threads are created CLONE_PARENT. They ask to get SIGKILL on parent SIGKILL, SIGSTOP on parent SIGSTOP, possibly also SIGSEGV on parent SIGSEGV (and other 'terminating' signals). They also ask to get SIGKILL on parent exec().<BR>
- Userspace exec() is rerouted (in _userspace_) to master thread. If it succeeds, all other threads automagically disappear (they were SIGKILLed by their own request); if it fails, return code gets back to originating thread via same ITC mechanism.<BR>
<BR>
Now, just when do I find the time to get a test8-pre1, rip out the silly tgid stuff, and code my idea?!?<BR>
<BR>
-az<BR>
</FONT>

<BR><U><B><I><FONT COLOR="#0000FF" SIZE=2 FACE="Arial">Alon Ziv &lt;<A HREF="mailto:alonz@zapper.com">mailto:alonz@zapper.com</A>&gt;</FONT></I></B></U><B><I></I></B>

<BR><I><FONT SIZE=2 FACE="Arial">System Architect (Client Team)</FONT></I>

<BR><I><U><FONT COLOR="#0000FF" SIZE=2 FACE="Arial">Zapper Technologies Inc. &lt;<A HREF="http://www.zapper.com/" TARGET="_blank">http://www.zapper.com/</A>&gt;</FONT></U></I>

<BR><I><FONT SIZE=2 FACE="Arial">Tel +972-3-6949226</FONT></I>

<BR><FONT SIZE=2 FACE="Arial"> </FONT>
</P>

</BODY>
</HTML>BEGIN:VCARD
VERSION:2.1
N:Ziv;Alon
FN:Alon Ziv
ORG:Zapper Technologies Inc.;Client
TITLE:System Architect
TEL;WORK;VOICE:+972 (3) 6949226
TEL;CELL;VOICE:+972 (54) 616935
TEL;WORK;FAX:+972 (3) 6965111
ADR;WORK:;;3 Azrieli Center;Tel-Aviv;;;Israel
LABEL;WORK;ENCODING=QUOTED-PRINTABLE:3 Azrieli Center=0D=0ATel-Aviv=0D=0AIsrael
KEY;X509;ENCODING=BASE64:
MIICXTCCAcagAwIBAgIDAe3OMA0GCSqGSIb3DQEBBAUAMIGUMQswCQYDVQQGEwJaQTEVMBMG
A1UECBMMV2VzdGVybiBDYXBlMRQwEgYDVQQHEwtEdXJiYW52aWxsZTEPMA0GA1UEChMGVGhh
d3RlMR0wGwYDVQQLExRDZXJ0aWZpY2F0ZSBTZXJ2aWNlczEoMCYGA1UEAxMfUGVyc29uYWwg
RnJlZW1haWwgUlNBIDE5OTkuOS4xNjAeFw0wMDAxMTIxNDU1NDR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YCwEX+qTqvy2aJGTRzWVJktaRXt+Ir0GZ
Pt5etD2gN1hrB2glzs3q2QnhSuSthyCZEytnyskCFODgipYOhzGvvf9CLYkckoQZgl6+O3Nq
xqiELFqvBvDknKMGDfPJ


EMAIL;PREF;INTERNET:alonz@zapper.com
EMAIL;INTERNET:alonz@zapper.com
REV:20000618T135002Z
END:VCARD
[unhandled content-type:application/x-pkcs7-signature]
\
 
 \ /
  Last update: 2005-03-22 12:38    [W:0.058 / U:54.132 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site