How does Intel TBB protect against stack overflows on the worker threads? In the early versions (and in the Intel TBB book) it was done by checking the depth of the tasks. To my understanding this feature was dropped. What other protection replaces it?
How does Intel TBB prevents endless stack filling?
Thank you very much,
hello, you can increase stack size if needed. AFAIR default thread size is 1 mb for a windows application and 2 mb for tbb workers. but nobody prevents to increase it.
TBB works efficiently with the stack on its high-level algorithms but if you want to program in low level tasks you need to think how much stack you need.
Thank you very much for your answer.
Yes, indeed, I can increase the stack at any time, but I don't have any guarantee that with a fixed stack size I will not overflow given enough tasks to be executed (and a lot of stealing). In my example, I have to budget the stack for 1000*1000 tasks to make sure that I don't overflow. To my assumptions that is a 500 times bigger stack! I cannot simply say: I'll give 500MB for all my working threads,
Isn't there a mechanism already implemented in TBB for limiting the stack growth?