[Gllug] Max number of pthreads in Linux ?

Daniel P. Berrange dan at berrange.com
Wed Mar 26 13:37:29 UTC 2008


On Wed, Mar 26, 2008 at 07:38:49AM +0100, salsaman at xs4all.nl wrote:
> Hi all,
> does anybody know the maximum number of threads libpthread will support on
> Linux ? The only information I could find was in

Since introduction of NPTL the number of threads is basically same as
the number of processes - so, on the order of 32768   IIRC.

Realistically you'll probably be limited by memory first - the default
thread stack size is 10 MB. So on i386 you'll run out of address space
for stacks around the 200 thread mark, unless you explicitly reduce the
stack size. 64-bit has plenty of address space so you're more likely
to be limited by actual memory usage for stacks before hitting PID limit.
Again even on 64-bit you may want to reduce stack size when creating
lots of threads

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/f5e773a1/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