I am implementing a random forest algorithm. Each tree is trained in a recursive fashion (increasing the size of the call stack as the tree gets deeper) and I can train one tree without any problem (or several trees in a sequential loop).
Training all the trees in a Parallel.For loop, however, leads to a stack overflow. I am aware that the stack size can be configured when using new Thread(), as stated in : How to change stack size for a .NET program?
However, is it possible to do it with Parallel.For ? Or do I have to write all my threads, specifying the size of their stack ?