Quantcast
Channel: Intel® C++ Compiler
Viewing all articles
Browse latest Browse all 1616

How can I work with local arrays and threads

$
0
0

Hi All!

I have VS2013+Intel Parallel Studio XE 2015+TBB 4.3

My current code has many functions that has local stack allocations by exampe

void fnc() {

  int arr[1024];

   .............

}

when I started use fnc() in parallel for (it is some form of parallel execution) I got bad concurrent perfomance according to VTune analyser

I done some replacement for the code: int *arr = malloc(sizeof(int) * 1024). malloc I got versus from tbb of course. In the result I got very good concurrent execution. Really I can't understand why local stack allocation has concurrency problems. Can anyone describe the problem? Has this issue easy solution?

Thanks! Sorry for my bad english!


Viewing all articles
Browse latest Browse all 1616

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>