My code uses Cilk & TBB in the same recursive functions, so that I can test them both with maximal code-sharing.
But when I use the TBB version with more than 3 threads, I get a crash at runtime with this error:
"Too many threads attempting to use Cilk".
This happens with the latest TBB release (TBB 3.0 Update 2 commercial-aligned release), as well as the one included with Parallel Studio XE.
This happens even if I set CILK_NWORKERS large or previously use the runtime API to set the number of workers large. (this is on a Core 2 Duo by the way, but I also tested a 4-way machine)
When I comment out the code containing the Cilk_spawn and Cilk_sync, then I can use lots of threads with TBB (e.g. 13).
So it appears that there is some interference between TBB & Cilk? This happens even when no calls to the Cilk APIs are made.
The TBB calls I use are currently task_group & mutexes, but I think this occurs with parallel_invoke & parallel_for as well.
BTW, this occurred in the Parallel Composer (non-XE) Beta a couple months ago, but I didn't get around to reporting it.