in reply to Looking for advice on how to tune stack size for threads

I tried a different approach to controlling stack size. Using Thread::Stack, you can control the number of threads by pushing a list or popping a scalar on the top of the stack:
#!/usr/bin/perl use strict; use warnings; use Thread::Stack; my $s = new Thread::Stack; $s->push(qw(thr1 thr2 thr3 thr4 thr5)); print my $size = $s->size, "\n"; $s->pop("thr1"); print $size = $s->size, "\n";

Replies are listed 'Best First'.
Re^2: Looking for advice on how to tune stack size for threads
by BrowserUk (Patriarch) on Dec 02, 2010 at 22:07 UTC

    Thread::Stack has nothing whatsoever to do with the OPs question.

    And the way you are using it in your "example" is completely useless.


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
Re^2: Looking for advice on how to tune stack size for threads
by fx (Pilgrim) on Dec 03, 2010 at 12:30 UTC

    Thanks for your reply. I already have a method with a similar thinking as to how to control the number of threads. However my question was intended to be slightly different. I was asking for advice as to where to look for info on setting the actual value for the stack size.

    fx, Infinity is Colourless