Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 17 Jun 2005 05:50:12 +0800
From:      David Xu <davidxu@freebsd.org>
To:        Marc Olzheim <marcolz@stack.nl>
Cc:        Andriy Tkachuk <ant@emict.com>, freebsd-threads@freebsd.org
Subject:   Re: more than 2k threads with -lpthread or -lthr
Message-ID:  <42B1F414.9040203@freebsd.org>
In-Reply-To: <20050616141857.GA63602@stack.nl>
References:  <200506161309.51431.ant@emict.com> <42B159E4.8080501@freebsd.org> <20050616141857.GA63602@stack.nl>

next in thread | previous in thread | raw e-mail | index | archive | help
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?42B1F414.9040203>