[omniORB] Significance of --enable-threads for building egcs-1.1

James O Flynn j8flynn@hursley.ibm.com
Tue, 27 Oct 1998 14:07:21 +0100


On Tue, 27 Oct 1998, you wrote:
>Shinji,
>
>Is it possible that your machine is running out of process slots when you
>have created (1024-2) threads?
>
>I'm curious what effect the --enable-threads option has. Could you or
>someone else send me privately the assembler output of my test program 
>with the -g option using egcs-1.1b that was compiled without
>--enable-threads? 
>
>
>Regards,
>
>Sai-Lai
>
>
>
>-- 
>Dr. Sai-Lai Lo                          |       Research Scientist
>                                        |
>E-mail:         S.Lo@orl.co.uk          |       Olivetti & Oracle Research Lab
>                                        |       24a Trumpington Street
>Tel:            +44 223 343000          |       Cambridge CB2 1QA
>Fax:            +44 223 313542          |       ENGLAND
Good point.
Look under /usr/src/linux/include/tasks.h
There is a value NR_TASKS or something which specifies the max tasks you can
have.
Note that max user tasks are defined in same file as TASKS/2.
Note that linuxthreads are lightweight processes!
Also worth looking at is the amount of stack allocated by each thread. If for
instance, as on NT which defaults to 1MB, your mapping away a Gig of your
stack, even if only a single page per thread, for a 1000 threads. You could 
eventually collide with the top of your heap.
Good luck!
James.
--
4920616d206e6f742061206e756d62657221