Intel® oneAPI Threading Building Blocks
Ask questions and share information about adding parallelism to your applications when using this threading library.

thread stack size


Is it possible to specify the stack size for the TBB threads? From looking at the source code this does not seem to be possible.

It is my experience that different platforms have different default stack sizes for threads started by pthread_create(). For example, the convex hull test cases don't run on IBM AIX unless I explicitly increase the thread stack size. It seems to me that an optional stack size argument inthe task_scheduler_init class would solve this issue. If no stack size is specified, the defaults are taken. Otherwise the user supplied value is used.

0 Kudos
1 Reply
You are right. There's no easy way to set the stack size and this is something we should fix. As you suggest, an optional second argument on task_scheduler_init would be the way to go. Technically, we'll do this as a two-argument constructor without a default argument, and retain the old single-argument constructor. That way old .exe files will still run correctly with the new version of the library.
0 Kudos