Click here to Skip to main content
15,867,771 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi
i am new to the concurrency programming

I have a 32bit app which uses a parallel_for
I need to add a clr dll to the app which requires me to mark the
"common language runtime support" property - which results in a debug error
that says "Error: concurrency runtime is not supported when compiling clr"

So i need to convert the parallel_for to a regular for
the parallel_for looks like that:
Concurrecny::parallel_for(0, numOfObjects, [filenames, stringsize, numFields](int value){
.....
});
in order to convert it to a regular for i should declare a function that looks like this:
int FunctionFor(char* filenames, int stringsize, int numFields, int value)
{...}
and call it in a for :

for (int j = 0; j < numOfObjects; j++)
{
FunctionFor(filenames, stringsize, numFields, j);
}

am i missing anything?

Thanks!
btw:

if i create an app which runs a parallel_for what headers\dlls (besides ppl.h)
should i add to the solution?

Thanks again

dj4400

What I have tried:

googling it
writing a sample with parallel_for
Posted
Comments
Shao Voon Wong 17-Jul-20 0:23am    
Without knowing your FunctionFor internals, your for-loop seems correct: you may want to unwrap FunctionFor's code because there is an overhead for function call.

For PPL, it seems including the header is sufficient.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900