How to initialize an immutable array

Sparsh Mittal sparsh0mittal at gmail.com
Fri Mar 1 12:05:39 PST 2013


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.


More information about the Digitalmars-d-learn mailing list