From owner-freebsd-threads@FreeBSD.ORG Fri Jun 17 10:17:28 2005 Return-Path: X-Original-To: freebsd-threads@freebsd.org Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 708AC16A41C; Fri, 17 Jun 2005 10:17:28 +0000 (GMT) (envelope-from ant@emict.com) Received: from mail.emict.com (brig.emict.com [212.90.172.42]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0023C43D53; Fri, 17 Jun 2005 10:17:27 +0000 (GMT) (envelope-from ant@emict.com) Received: from [10.0.0.232] (unknown [10.0.0.232]) by mail.emict.com (Postfix) with ESMTP id 29A8133ED1; Fri, 17 Jun 2005 13:17:26 +0300 (EEST) From: Andriy Tkachuk Organization: eMICT To: David Xu Date: Fri, 17 Jun 2005 13:17:23 +0300 User-Agent: KMail/1.8 References: <200506161309.51431.ant@emict.com> <20050616141857.GA63602@stack.nl> <42B1F414.9040203@freebsd.org> In-Reply-To: <42B1F414.9040203@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200506171317.24632.ant@emict.com> Cc: Marc Olzheim , freebsd-threads@freebsd.org Subject: Re: more than 2k threads with -lpthread or -lthr X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Jun 2005 10:17:28 -0000 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 > >