Re: Slow pthread_create() under high load

From: Ulrich Drepper (drepper@redhat.com)
Date: Tue Mar 28 2000 - 14:41:19 EST


yodaiken@fsmlabs.com writes:

> So the nonmanager threads do
> sigaction(n,s)
> === save local copy of s,n,thread_id
> real_sigaction(realprocessid(myid));
> if unblocked a signal that is user_space pending
> kill self with that signal
>
> Now the information about who blocks what is available in user space
>
> kill(gettpid(),n) where gettpid has been fixed to get the
> root pid
> === find someone who is not blocking and
> kill(someone,n)
> if all threads block, then mark signal
> as pending

You are completely neglecting that the signals are not coming alone:

- there is a signal context. If the process which receives the signal
  first (mainly the manager) simply returns the signal context on its
  stack is lost.

  Copying it means garbage collection of some kind

- you have to handle certain signal special (segfault, stop/continue).
  Especially the later contains the possibility for arbitrary many
  races if not done in the kernel.

- RT signals have to transport data which, again, can be in the signal stack.

- sigaltstack must continue to work

I'm cutting it short here.

-- 
---------------.      drepper at gnu.org  ,-.   1325 Chesapeake Terrace
Ulrich Drepper  \    ,-------------------'   \  Sunnyvale, CA 94089 USA
Red Hat          `--' drepper at redhat.com   `------------------------

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



This archive was generated by hypermail 2b29 : Fri Mar 31 2000 - 21:00:22 EST