[Gllug] Max number of pthreads in Linux ?

Tethys sta296 at astradyne.co.uk
Wed Mar 26 09:38:50 UTC 2008


--------

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).

I know Ingo had an excessively large number of threads (1e5? 1e6?
Somewhere around there anyway) when he was testing NPTL, which
should be far more that you'd ever need in a real program. But
if you find you're needing a significant number of threads,
I'd say it's probably time to take a step back and revisit
your design[1]. Just MHO.

Tet

[1] Yes, there are some cases where having large numbers of threads
    is a good solution to the problem. But they're few and far between.
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list