- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
I am doing some measurement with TBB. I noticed that the first call to tbb::parallel_for is slow. I thought, this might come from the task scheduler initialization that is executed the first time a tbb algorithm is called. And yes it had an influence but I don't realy understand the behaviour.
Inserting
[cpp]task_scheduler_init();[/cpp]
before the first call to tbb::parallel_for is made reduces the time needed for the first call to tbb::parallel_for.
However when I insert:
[cpp]task_scheduler_init init;[/cpp]
the time for the first call to tbb::parallel_for is even shorter but I couldn't get any speedup during the measurement (further calls to tbb::parallel_for)
Is this behavior explainable and what should I call before the measurements to get meaningful results. The used test file is attached.
Thanks for any hints
Link Copied
- « Previous
-
- 1
- 2
- Next »
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
task_scheduler_init();
If you used the above to initialize tbb scheduler, I would like to ask you to verify that the application actually created the expected number of threads. In the past, we were bitten by the same issue several time. The cause was the compiler was too smart, it destroyed the object as soon as it is intialized. Take a look at for example the section 'Explicit Instantiation of Temporaries' in here
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- « Previous
-
- 1
- 2
- Next »