Re: SCO: "thread creation is about a thousand times faster than on native Linux"

From: yodaiken@fsmlabs.com
Date: Thu Aug 24 2000 - 11:03:03 EST


On Thu, Aug 24, 2000 at 09:29:35AM -0700, Linus Torvalds wrote:
>
>
> On Thu, 24 Aug 2000 yodaiken@fsmlabs.com wrote:
> >
> > How about allowing the thread root process to do all that junk by giving it
> > raw signals - e.g. delivering SUSPEND - and then letting it distribute
> > via a pthread_kill?
>
> I don't think that is a good approach from a performance point of view -
> it's too similar to what we already do.
>
> HOWEVER, I suspect that pthreads compatibility with signals may require us
> to have that thread root process (even if it isn't used for anything
> else), because I think that makes our signal handling be POSIX-conformant:
> if I remember correctly POSIX does allow the notion of having signals
> handled in a special thread that doesn't do anything else. It would still

The root thread can tell Linux: I'm a pthreads root thread, I don't want
POSIX signals, I want raw signals.
The advantage is that for things like kill(threaded_pid,SUSPEND)
and kill(threaded_pid,SOME_SIGNAL_THAT_POSIX_SAYS_A_RANDOM_THREAD_GETS)
does not have to be in a place where it slows down sensible signal
usage.

Libc can make sure that all the usual signal operations in non-root
threads update the per-thread signal information and then the root
thread can do:
            got_a_signal:
                        find a thread that takes this signal
                        pthread_kill(that_thread,signal);

Signals are slower but using this feature of signals/threads is dumb
anyways.

> mean that if you create 'n' pthreads threads, you actually get 'n+1'
> kernel threads, but hey, one of them is going to be dormant pretty much
> all the time.

>
> Linus

-- 
---------------------------------------------------------
Victor Yodaiken 
Finite State Machine Labs: The RTLinux Company.
 www.fsmlabs.com  www.rtlinux.com

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Thu Aug 31 2000 - 21:00:13 EST