[Gllug] Max number of pthreads in Linux ?

Daniel P. Berrange dan at berrange.com
Wed Mar 26 13:39:18 UTC 2008


On Wed, Mar 26, 2008 at 09:38:50AM +0000, Tethys wrote:
> --------
> 
> salsaman at xs4all.nl writes:
> 
> >Hi all,
> >does anybody know the maximum number of threads libpthread
> >will support on Linux ? The only information I could find
> >was in /usr/include/bits/local_lim.h:
> 
> No, but I'd have thought a simple for loop around pthread_create()
> would give you an empirical answer quite quickly (at least for your
> particular system).

Nope, that'll give you an artifically low limit because of the huge
default stack size which will waste address space & memory. I've created
on the order of 10,000 threads before, not that they did any useful 
work - I was merely demonstrating the awesome scalability of NPTL threading
on Linux in comparison to Solaris.

Dan.
-- 
|: http://berrange.com/     -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://freshmeat.net/~danielpb/    -o-   http://gtk-vnc.sourceforge.net :|
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 196 bytes
Desc: Digital signature
URL: <http://mailman.lug.org.uk/pipermail/gllug/attachments/20080326/2389405d/attachment.pgp>
-------------- next part --------------
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug


More information about the GLLUG mailing list