how to handle shared arrays?

Ali Çehreli acehreli at yahoo.com
Thu Jun 21 15:13:28 PDT 2012


On 06/21/2012 02:30 PM, maarten van damme wrote:
 > Oh thank god, this helps soo much.

Yay! :)

Thinking more about it, assumeUnique is a more general solution which 
may not be needed in every case. As long as the worker is happy with an 
immutable(Result) slice, the following delegate works as well. No more 
assumeUnique:

             (Command command) {
                 writeln("worker - received command");

                 immutable(Result)[] results;
                 results ~= immutable(Result)();
                 results ~= immutable(Result)();

                 writeln("worker - sending results");
                 owner.send(results);
             },

Ali



More information about the Digitalmars-d-learn mailing list