I am making a program which accesses 1D array using for loop and
then I am parallelizing this with foreach, TaskPool and parallel.
The array does not need to change, once initialized. However, the
parallel version takes more time than serial version, which I
think may be because compiler is trying to make sure that array
is properly handled by different threads.
So, is there a way, an array can be made immutable and still
initialized? Thanks a lot for your time.
- How to initialize an immutable array Sparsh Mittal
-