Create many objects using threads

Caslav Sabani via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon May 5 10:14:53 PDT 2014


Hi,


I have just started to learn D. Its a great language. I am trying 
to achieve the following but I am not sure is it possible or 
should be done at all:

I want to have one array where I will store like 100000  objects.

But I want to use 4 threads where each thread will create 25000 
objects and store them in array above mentioned. And all 4 
threads should be working in parallel because I have 4 core 
processor for example. I do not care in which order objects are 
created nor objects should be aware of one another. I just need 
them stored in array.

Can threading help in creating many objects at once?

Note that I am beginner at working with threads so any help is 
welcome :)


Thanks


More information about the Digitalmars-d-learn mailing list