bug-glibc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: pthread_create failing under stress


From: Cal Erickson
Subject: Re: pthread_create failing under stress
Date: Wed, 17 Oct 2001 08:35:58 -0700

All,
Here is a patch to a 2.4.2 kernel to prevent the creation of zombie
processes
when threads exit under gdb.

--- kernel/orig_exit.c Wed May 23 12:46:10 2001
+++ kernel/exit.c Tue Jul 31 09:05:51 2001
@@ -348,8 +348,7 @@
   * and we were the only connection outside, so our pgrp
   * is about to become orphaned.
   */
-
- t = current->p_pptr;
+ t = current->p_opptr;

  if ((t->pgrp != current->pgrp) &&
      (t->session == current->session) &&
@@ -561,7 +560,7 @@
      REMOVE_LINKS(p);
      p->p_pptr = p->p_opptr;
      SET_LINKS(p);
-     do_notify_parent(p, SIGCHLD);
+     do_notify_parent(p, p->exit_signal);
      write_unlock_irq(&tasklist_lock);
     } else
      release_task(p);

Cal Erickson
Stefan Hoffmeister wrote:

> : On Tue, 09 Oct 2001 23:13:59 -0300, Miguel Freitas wrote:
>
> >pthread_create to fails with "Resource temporarily
> >unavailable" error.
> ...
> >I checked with gdb and i'm sure these 2 threads are
> >joined before the new ones are created (no thread "leakage").
>
> If this happens only under the control of a debugger, this is probably
> due to a kernel defect where signals are not sent out properly
> signalling the termination of a thread.
>
> In my experience, under a debugger you can create at most 1024 - 1 (the
> manager thread) threads (or even one less, don't remember the exact
> number). No amount of releasing thread resources will help you.
>
> FWIW, don't you think it would be wiser if you didn't recreate threads,
> but simply implemented a thread cache with the worker threads blocking
> on a semaphore and being fed with data?
>
> _______________________________________________
> Bug-glibc mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/bug-glibc

--
===========================================================================
Cal Erickson                 MontaVista Software Inc.
Linux Consultant             1237 E. Arques Ave.
Phone (408) 328-0304         Sunnyvale CA 94085
Fax   (408) 328-9204         web http://www.mvista.com
===========================================================================






reply via email to

[Prev in Thread] Current Thread [Next in Thread]