lkml.org 
[lkml]   [1996]   [Nov]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: CLONE_PID (was: POSIX.1b semaphores)

From: Xavier Leroy <Xavier.Leroy@inria.fr>
Date: Tue, 19 Nov 1996 10:29:15 +0100 (MET)

As you can see, this CLONE_PID flag, although working fine, opens a
whole can of worms in the area of signal delivery. If anyone has
ideas on how to approach this problem, please let me know.

Add a new mask of signals to task_struct, the implementation then
would be:

kill(p, sig)
{
for_each_thread_with_pid(p, tsk)
p->normal_sig_mask |= (1<<(sig-1));
if(has_threads(p))
find_task(p)->global_sig_mask |= (1<<(sig-1));
}

signal_deliver(tsk)
{
if(tsk->global_sig_mask & (1 << (sig - 1))) {
for_each_thread_with_pid(tsk->pid & PID_MASK, tmp)
tmp->normal_sig_mask &= ~(1<<(sig-1));
tsk->global_sig_mask &= ~(1 << (sig - 1));
} else {
tsk->normal_sig_mask &= ~(1<<(sig-1));
}
}

Thats gross as hell, and doesn't consider possible races, but it is
just the general idea.

--------------------------------------------////
Yow! 10.49 MB/s remote host TCP bandwidth ////
over 100Mb/s ethernet. Beat that! ////
-----------------------------------------////__________ o
David S. Miller, davem@caip.rutgers.edu /_____________/ / // /_/ ><

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