tech-userlevel archive

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

Re: Possible pthreads memory leak



On Sun, 17 Jan 2010 09:47:03 +0000 (UTC)
mlelstv%serpens.de@localhost (Michael van Elst) wrote:

> and the pullup to netbsd-5 branch occured 6 days ago...
> 
> 2010-01-11 01:47  snj
> 
>         * pthread.c (1.106.2.2): Pull up following revision(s) (requested
>           by christos in ticket #1235):         lib/libpthread/pthread.c:
>           revision 1.113 Don't just look only at the first element in the
>           deadqueue to find lwp's to reuse, because if we lose the race
>           with the kernel we are never going to reuse any elements. Look in
>           the whole list instead.

ident(1) shows that I have 1.106.2.2, so my tests were done with the
fix applied.  This probably explains the more serious leaks Zach
experiences on 5.0.1.  Is it still expected that without inserting a
syscall to cause a context switch a small leak still occurs over time
with the fix?

I realize that in real world scenarios this probably does not matter
very much, however.  An application would need to be totally CPU-bound
and to at the same time need to always create new threads without
making any voluntary context switches, while such number-crunching
applications probably initially allocate a number of threads and keep
them alive for optimal performance...

Thanks,
-- 
Matt


Home | Main Index | Thread Index | Old Index