c++ - Performance with MS concurrency::parallel_for() for a single iteration -


i suppose there have been numerous questions regarding performance issues while trying achieve concurrency parallel_for. have noted performance drop while trying parallelize memory-access extensive for loops using parallel_for. application area working on image processing.

surprisingly performance drop seen if create loop single iteration processed parallel_for!!

what mean have code block under, executes in 7 sec without parallelisation

<code block without parallelisation>   //(executes in 7 seconds) 

if enclose above code within parallel_for loop under, performance increases 18 seconds.

parallel_for(0,1,[&](int random_var){   //(executes in 18 seconds) <code block without parallelisation>  }); 

i fail understand such behaviour. cause such huge overhead processing. in such case assume there should not memory bandwidth related issues?

let me know in case require more information specific problem facing.

because 1 iteration inside parallel_for going execute code in thread. there preemption main thread. there other thread related book keeping works, take time.


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -