Re: kernel thread support - LWP's

Andi Kleen (ak@muc.de)
Sun, 18 Jul 1999 20:53:50 +0200


On Sun, Jul 18, 1999 at 08:25:51PM +0200, Ulrich Drepper wrote:
> Andi Kleen <ak@muc.de> writes:
>
> > You send a signal back and do a sigwaitinfo() waiting for it. The signal
> > can carry a status code.
>
> Using yet another signal and system calls? Everybody is complaining
> that the thread creation is so much slower than a simple clone() but
> when I explain what I need people do not even listen. You've seen the

Sending SIGSTP or a unrelated signal have near the same cost.

Similar waitpid for a STOP and sigwaitinfo.

It depends on what you find more important:
latency from creation to child run [sigqueueinfo/sigwaitinfo have a slight advantage
here because it can simply run through without caring about the parent]
or
latency from calling pthread_create to its return [SIGSTP/waitpid may be better here,
because the final thread restart is decoupled from the caller]
On UP it probably makes not much difference because one CPU has to do all the work
anyways, on SMP it may look different.

> code I've orignially posted, The code size increase in the kernel is
> minial. What can possibly be wrong with this?

What I didn't like with your idea is that it is 100% equivalent (even from the
work the kernel has to do) to kill(getpid(), SIGSTP); at the beginning
of the child.

-Andi

-- 
This is like TV. I don't like TV.

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