in reply to Looking for advice on how to tune stack size for threads
I'd set it to: stack_size => 4096 and then try it.
Actually. I've modified my perl binary so that the 'default' value used, when no stack size is explicitly stated. is 4096, this being the minimum that can be used on my system. So far, I've never encountered a problem due to stack.
The reason you can get away with this, is because for the most part, Perl doesn't use the C/processor stack.
Perl manages it own stack (actually:stacks), and these are allocated from the heap. Until recently, very complex regex could consume prodigious amount of the C stack, but then p5p (I think: dave_the_m?) converted the then recursive regex engine to iterative, thus removing perl's last big stack dependency.
However, if you use modules with badly written XS or C components that either allocate large items/quantities of items on their stacks; or enter unbridled recursion, they may cause your threads to run out of (thread) stack if you set it too low.
Personally, I've never encountered such a problem, even with my extreme minimalism, but I'm also quite choosy about the modules I use.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Looking for advice on how to tune stack size for threads
by fx (Pilgrim) on Dec 03, 2010 at 12:37 UTC | |
by BrowserUk (Patriarch) on Dec 03, 2010 at 13:24 UTC |