This is the mail archive of the
mailing list for the glibc project.
Re: NPTL not properly cleaning up threads on SMP systems?
On 2 June 2012 20:12, Carlos O'Donell <firstname.lastname@example.org> wrote:
>> I haven't observed this issue on single-processor systems
>> (ran the test on a dedicated user with a RLIMIT_NPROC of NB_THREADS + 3 for hours without getting EAGAIN).
> This looks like you have a kernel bug.
> On an x86-64 (X5560 4 core [8 hts], ~50GB RAM) system running Ubuntu
> 10.04.2 LTS 2.6.32-31-generic kernel I see 1-3 threads active at any
On a serious note, I see this all the time on my tests runs and it is
in fact a kernel issue. The problem here is that the kernel needs to
signal the joining thread before it exits and the time taken from that
point to actual freeing of task resources seems to be longer than the
time it takes for the process to spawn another thread after joining
and for that thread to return.
A very simple way to eliminate this is to introduce a very small
usleep within the thread function. This eventually needs to be fixed
within the kernel, to try and get the signal as close to the task
reaping point as possible.