[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: pthread_create failing under stress
From: |
Andreas Jaeger |
Subject: |
Re: pthread_create failing under stress |
Date: |
Wed, 17 Oct 2001 18:07:27 +0200 |
User-agent: |
Gnus/5.090004 (Oort Gnus v0.04) XEmacs/21.4 (Artificial Intelligence) |
Cal Erickson <address@hidden> writes:
> All,
> Here is a patch to a 2.4.2 kernel to prevent the creation of zombie
> processes
If it's for the kernel, please send it to the kernel mailing list,
Thanks,
Andreas
> 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
--
Andreas Jaeger
SuSE Labs address@hidden
private address@hidden
http://www.suse.de/~aj