Date: Fri, 17 Jun 2005 13:17:23 +0300 From: Andriy Tkachuk <ant@emict.com> To: David Xu <davidxu@freebsd.org> Cc: Marc Olzheim <marcolz@stack.nl>, freebsd-threads@freebsd.org Subject: Re: more than 2k threads with -lpthread or -lthr Message-ID: <200506171317.24632.ant@emict.com> In-Reply-To: <42B1F414.9040203@freebsd.org> References: <200506161309.51431.ant@emict.com> <20050616141857.GA63602@stack.nl> <42B1F414.9040203@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
thank you guys, all started working. actually the problem with sigsegv was not about stack size - my fault - program was killed with this signal even when number of threads was not large. on 5.4-STABLE Fri Jun 17 09:33:54 EEST 2005 kernel this problem disappeared. Note, that with old kernel (from 5.4-RELEASE) but with new libpthread (from 5.4-STABLE) the problem still was present, that's why i untimely sayd that this bug present in RELENG_5_x. So i suppose, that something in 5.4-STABLE kernel is fixed regarding threads compared to 5.4-RELEASE kernel. after this another problem appeared - no more, than 30xx threads where started. But i set stacksize to 2 pages (8K) and all started working fine. Again: sorry for misinformation and thank you for help. Regards, Andriy Tkachuk. On Friday 17 June 2005 00:50, David Xu wrote: > Marc Olzheim wrote: > > >On Thu, Jun 16, 2005 at 06:52:20PM +0800, David Xu wrote: > > > > > >>Both libpthread and libthr use 1M bytes stack on 32bits platform > >>and 2M bytes stack on 64bits platform. I think 2k threads needs > >>2G stack on i386, this is too large. > >> > >> > > > >In which case pthread_attr_setstacksize() might help ? > > > >Marc > > > > > pthread_attr_setstacksize definitively helps, libc_r default uses 64k > stack for thread, this is very small stack. > > Here two sysctl also have to tuned to numbers larger than 2000 for > libthr and libpthread: > kern.threads.max_groups_per_proc > kern.threads.max_threads_per_proc > > David Xu > >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200506171317.24632.ant>