Intel® Threading Building Blocks

Conditional parallelization

Hello,

Does TBB provide a mechanism for conditional parallelization?

For example, assume the following code, and I want to parallelize this loop only when loopCount is larger than 1000 (if not, execute sequentially to avoid unnecessary parallelization overhead).

for( int i = 0 ; i < loopCount ; i++ ) { /* do something */ }

I want to do

if( loopCount > 1000 ) { parallel_for(...) { ... } } else { for(...) { ... } }

without replicating the loop body. It will be very nice if I have something like "parallel_for_if" :-)

Parameter (Grainsize) doesn't take effect in Template <parallel_for>

When I set the grainsize to 100/200/500/1000, results are the same.

...

parallel_for(blocked_range<size_t>(0, to_scan.size(), 200), //i changed the parameter to 100/200/500/1000
SubStringFinder( to_scan, max, pos ));

...

the output ranges as follows, it seems that the grainsize is more than 1000 and the parameter doesn't take effect at all.

...

The semantics of TBB's conaintainers

Hi!

Could Someone answer my question, please?

I have added a concurrent map to my project. The question is, how many instances of one single value would be temporarilly existing while modifing the data of container (for example, insert() method)? The qestion is not about copy/move semtantics. I have read, that movable semantics is not impleneted int the TBB yet. Is there a reference counting important for the values? Would it be possible to create the movable constructor and the operator and disable the copy ctor and operator?

Support for Clang on Linux

We have been using TBB on Linux with g++ for a few years.  Now we would like to try to use TBB with Clang.  Does anyone have a version of build/linux.clang.inc that I could use?

Are there plans to release support for Clang?

FYI: I downloaded the latest stable release of TBB (4.1 Update 1), and I have Clang 3.3 (fairly recent svn version) built with g++ 4.7.1 on Fedora 14.

[SOLVED] Setting the value of a tbb::atomic from standard input

Hi,

this is just something that occurered to me and decided to try. Would it be possible/useful to make something like this work?:

tbb::atomic<char> q;
std::cin>>q;

I tried and got this error:

 error: ambiguous overload for 'operator>>' in 'std::cin >> q'
.

Thanks.

Pages

S’abonner à Intel® Threading Building Blocks