On Wed, 30 Jul 2003 11:01:33 +0800
Verdi March
About redesigning the software, it's kinda difficult. I'm working on a simulation, it's built using another a simulation library (written in C) that utilizes thread. So it's the library that do all the thread-thing(yes, the library is GPL, but the purpose of using it is to avoid writing my application from scratch ;-). Later on, I need to do large simulation, which will generate lots lots of threads. You can set the stack size with pthread_attr_setstacksize, but that should never be less than PTHREAD_STACK_SIZE. I think you are between the preverbial rock and a hard place. You can make the appropriate changes, but you still risk running out of resources. I would like to see Linux start using mmap to allocate thread control blocks and stacks rather than the heap, but that may require some extensive changes to the kernel.
--
Jerry Feldman