Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
48 Views

Static linking tbb

Hi,

I'm writing a library where I'm linking to the open source version of tbb built as a static lib. This works fine but when I static link my library into a program it asks for the tbb library and I want my library to be self contained so people can use it without needing to link against tbb themselves. I've had a similar thing with boost where you can use a preprocessor definition to make your library self contained. I'm wondering how I can achieve this with tbb? 


Thanks a lot!

0 Kudos
3 Replies
Highlighted
Black Belt
48 Views

You shouldn't try to do that, unless you want to do your users a great disservice. Oversubscription hurts performance, so TBB is presented as a dynamically linked library partly to get all parts of a program to coordinate through shared constructs and thus help achieve composability.

0 Kudos
Highlighted
Beginner
48 Views

I'm aware of the issue of multiple tbb schedulers being active and my thought was to let the user disable the scheduler in the library and supply their own if they are using tbb themselves (although I admit I haven't looked into that possibility yet). Would that not work? 

I don't see how having tbb as a dynamic library would stop an oversubscription situation if the user is managing threads themselves or using something like openmp in their program?

0 Kudos
Highlighted
Black Belt
48 Views

I'm sorry, but I don't see the point of that.

And TBB indeed can't magically cure externally caused oversubscription.

0 Kudos