Re: Passing a value by reference to function in taskPool

2013-03-02 Thread Sparsh Mittal
Thanks a lot for your reply.

Re: Passing a value by reference to function in taskPool

2013-03-01 Thread Ali Çehreli
On 03/01/2013 06:51 PM, Sparsh Mittal wrote: > Possibility 1: Here, I wanted to pass a value by reference to myFunc, > but when I read that value in main function, its value is not changed at > all? This is a known issue and is documented in the std.parallelism module: http://dlang.org/phobos

Passing a value by reference to function in taskPool

2013-03-01 Thread Sparsh Mittal
Here is a code: import std.stdio, std.datetime, std.random, std.range, std.parallelism; enum long numberOfSlaves = 2; void myFunc( ref long countvar) { countvar = 500; writeln( " value of countvar is ", countvar); } void main() { long count1=0, count2=0; alias typeof(task!(myFunc)(