warkent@ltisun.epfl.ch ((Ken Warkentyne)) (04/17/91)
If there are any LWP experts out there, I have a question for you. Does LWP really recuperate the stacks of terminated threads? The documentation says that it does yet my test program implies that it doesn't. The test program is very small so here it is: #include <lwp/lwp.h> #include <lwp/stackdep.h> thread_t tid1; task1() { putchar('.'); }; main() { printf("main thread starting\n"); (void)pod_setmaxpri(MINPRIO); lwp_setstkcache(80000,20); for (;;) { lwp_create(&tid1, task1, MINPRIO, LWPNOLASTRITES, lwp_newstk(), 0); lwp_yield(tid1); lwp_destroy(tid1); } } The lwp_setstkcache command creates an initial stack cache with 20 80,000 byte stacks. After running for a couple of seconds on a sparc station, the UNIX process containing the lwp threads exceeds the 90Mbyte virtual memory limit on the machine. Changing the stack size merely changes the amount of time that the process runs before dying. Thanks, Ken Warkentyne - warkent@ltisun.epfl.ch Laboratoire de Teleinformatique, EPFL, Suisse.