Re: clone() and CLONE_PID

Alon Ziv (alonz@cs.technion.ac.il)
Thu, 9 Sep 1999 23:45:55 +0200 (IST)


On Wed, 8 Sep 1999, The Lost Wizard wrote:

> On 9 Sep 1999, David Wragg wrote:
>
> > POSIX is just an API; it doesn't tell you how to design a
> > kernel. Generally Linux directly implements POSIX features because
> > that is simpler, but for POSIX threads it's worth stepping back and
> > asking what it really needs from the kernel. My opinion is that doesn't
> > include pid sharing and tids.
> >
> > David Wragg
>
> It is my understanding that signals cannot be guaranteed to work
> according to the POSIX threads specification without the CLONE_PID option.
> Please don't say this can be done reliably in userspace; it takes a severe
> performance hit for signal handling and adds several levels of complexity
> to any pthreads library that uses clone. The way I understand it (and it
> has been a while since I read anything on the subject) is that certain
> fatal signals are supposed to be received by all threads/affect all
> threads no matter which thread receives it. I believe this includes at
> least one signal that cannot be handled. So how do you propogate this
> signal reliably to all other threads in the process?
>
It is entirely possible that to properly implement the exact POSIX signal
semantics, we'll need some more additions to clone() to enforce this.
However, it's still completely unrelated to pid sharing (in fact, I've
already got a version of LinuxThreads where all threads believe they share
pid, and have separate tid's; and there's even some support for userspace
signal handling in place...)

-az

------------------------+----------------------------------------------------
. __ | Phone: +972 3 5340753 (home), +972 3 9685882 (work)
_| / | email: alonz@usa.net
/ | /_ Alon Ziv | smail: 33 Ha-Rama St., Ganey Tiqwah 55900, Israel
------------------------+----------------------------------------------------
<<<(((this place reserved for that ultra-wise oneliner I haven't found.)))>>>

-
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/