Thanks a lot for your reply.
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
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)(