How to use large size array, which are shared

Sparsh Mittal sparsh0mittal at gmail.com
Sun Jan 27 13:44:38 PST 2013


Hello

I read: "The total size of a static array cannot exceed 16Mb. A
dynamic array should be used instead for such large arrays."

I want to make array which is shared but also has a large size,
e.g.

       shared WorkerClass[numberOfWorkers] myWorkerArray;

where numberOfWorkers is large.

If I try to do:

       shared WorkerClass[] myWorkerArray;
       int main()
       {
         .....
         myWorkerArray = new WorkerClass [numberOfWorkers];
       }

the compiler does not allow me to do so.

My motivation is to create a global array, which I can use in
multiple functions which are created using "spawn".

Can you please help me.


More information about the Digitalmars-d mailing list