LWP - do stacks really return to the cache?

Ken Warkentyne warkent at ltisun.epfl.ch
Wed Apr 17 11:00:00 AEST 1991


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 at ltisun.epfl.ch
                 Laboratoire de Teleinformatique, EPFL, Suisse.



More information about the Comp.sys.sun mailing list