Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tbb::global_control in Embree might affect whole application #507

Open
LauraHorst opened this issue Dec 11, 2024 · 0 comments
Open

tbb::global_control in Embree might affect whole application #507

LauraHorst opened this issue Dec 11, 2024 · 0 comments

Comments

@LauraHorst
Copy link

It seems like the static tbb::global_control object in Embree sometimes affects the rest of the application using Embree.

Unfortunately I haven't been able to construct a simple example, so here is a rough explanation of what is happening in our application:

There are several tbb::task_arenas in our code which are given a parameter setting their maximum amount of threads. In between there is Embree code running. Sometimes when tbb::task_arenas are supposed to run single threaded they instead run multi threaded, but only if Embree code has run before.

So far I haven't been able to find the exact cause. The parameters for the tbb::task_arenas are set correctly at all times. Setting tbb::global_control immediately before every tbb::task_arena creation (and resetting afterwards) leads to the original/desired behaviour. Because tbb::global_control only has an effect during its lifetime, my guess is that the static one in Embree might mess up the rest of the application.

Thread counts behave as desired with TBB v2021.5.0 (interface version 12050) and Embree v3.13.4.
With TBB v2021.13.0 (Interface version 12130) thread counts misbehave, both with Embree v3.13.4 and v4.3.3. Since it only seems to happen in combination with Embree I'm quite sure that it's an Embree problem nonetheless.

This affects both Windows and Linux (WSL).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant