Date: Sat, 21 Feb 2015 08:34:44 +0800 From: Erich Dollansky <erichsfreebsdlist@alogt.com> To: freebsd-stable@freebsd.org Subject: Re: pthread leaky with resources? Message-ID: <20150221083444.5759b1d8@B85M-HD3-0.alogt.com> In-Reply-To: <54E75087.7080100@shrew.net> References: <54E65E05.2040101@shrew.net> <20150220100446.GL34251@kib.kiev.ua> <54E74D17.6020209@shrew.net> <Pine.GSO.4.64.1502201010580.16244@sea.ntplx.net> <54E75087.7080100@shrew.net>
next in thread | previous in thread | raw e-mail | index | archive | help
Hi, On Fri, 20 Feb 2015 09:19:35 -0600 Matthew Grooms <mgrooms@shrew.net> wrote: > > When a thread is created, it will first try to reuse cached > > resources before allocating new resources. > > > > If you are creating 200 threads, for instance, try destroying those > > 200 threads, then create 200 new threads. You shouldn't see much > > change in resources, as libpthread should use the cached > > resources. If you see a double in the amount of resources used, > > then that would seem like a bug. > > > Thanks for the response. Let me do some more testing. I know that OS > developer time is a precious resource. If I can find more evidence of > the problem I will present it. > I am currently also working on a multi threaded program and have had also a problem like this. I thought it was an error 100% on my side. As I also did at the same time an upgrade to 10.1-STABLE FreeBSD 10.1-STABLE #2 r276328 it could be that there was really some problem in a library. Some of the threads just return while others are cancelled. If you have cancelled threads, do you use pthread_cleanup_push and pthread_cleanup_pop? Erich
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20150221083444.5759b1d8>