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

Newbie question - why does TBB have a dll?

saaron
Beginner
745 Views
Hi,
I am new with TBB and this seems like a stupid question. Why does TBB have a dll file when it is supposed to be a template library?
thanks.
0 Kudos
4 Replies
RafSchietekat
Valued Contributor III
745 Views

TBB provides some of its functionality in the form of templates, but it is not just a template library. It is specifically a dynamically linked library to allow its applications to be brought together into one program without explicit coordination.

0 Kudos
saaron
Beginner
745 Views
Quoting - Raf Schietekat

TBB provides some of its functionality in the form of templates, but it is not just a template library. It is specifically a dynamically linked library to allow its applications to be brought together into one program without explicit coordination.


Thanks Raf. Can you (or anyone else) please guide me where can I learn more about the inner details (all the platform specificities) of TBB?

0 Kudos
robert-reed
Valued Contributor II
745 Views
Quoting - saaron
Thanks Raf. Can you (or anyone else) please guide me where can I learn more about the inner details (all the platform specificities) of TBB?

Well, you have access to the ultimate authority. Intel Threading Building Blocks is an open source project and you can find details as deep as you want to go by looking at it. Code reading is a great exercise for learning structure, and as someone who supports this library, I'm constantly visiting newer versions of the source as they appear to understand how that code is evolving and structurally changing as new features appear.

Because of the noted distinction between the template header files and the separate library source, I find navigation easiest done by having some tool to link function calls to definitions so that you can functionally navigate across file boundaries. My personal preference is the tags feature in vim, combined with a robust ctags. From the header file directory I specify:

[plain]ctags -R ./* ../../src/*[/plain]

This way my single tags file links function references among and within the header files but spans to all of the source, including test files, tbb and tbb_malloc. But that's pretty arcane. I'm sure there are other navigation tools that would suffice.

0 Kudos
uj
Beginner
745 Views
Quoting - saaron
Hi,
I am new with TBB and this seems like a stupid question. Why does TBB have a dll file when it is supposed to be a template library?
thanks.


What you're probably thinking of is a so called"header only" library. This means that the library consists of selfcontained source code only. It doesn't come with any precompiled code you need to link to your program.

But note that a template library isn't necessarily a "header only" library just because the templates themselves are supplied in source codeform. Template libraries may very well required code to be linked, and that'sthe case with TBB.

To use TBB well I suggest you get a copy of Intel Threading Building Blocks by James Reindeers. In a chapter called Memory Allocators it's described what you need to do to get TBB working. I suppose you can get this information from elsewherebut the bookcontains so muchuseful information that it's pretty much essential anyway.
0 Kudos
Reply