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

Thread stack tuning is more an art than a science. At least in C you know how big things on the stack are. If your threads are fairly simple (ie, don't create arbitrarily-deep call-stacks), you can usually make a rough guess, add 20%, and be done with it. Otherwise, I usually have to start with the default, and drop it in 256k increments until it dies. Then go back to the last success, then add 20-40% (depending on complexity of boundary condition handling)

fnord

  • Comment on Re: Looking for advice on how to tune stack size for threads

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:33 UTC

    "Thread stack tuning is more an art".

    I hate art and was suspecting that the answer might actually be something like this. What I really wanted (hoped, wished for deep down...) was a nice hard'n'fast formula. I didn't really think they'd be one and it seems like that is correct.

    Thanks for your reply. It backed up my own suspicions. Trial and error it is!!!!

    fx, Infinity is Colourless