Hi,
Another thing that I noticed about this issue, is that in this
isolated test case, the problem only happens if the added value
is returned from the function that performs the 'yield()'.
If I call 'yield()' directly, then add to 'globalSum', or if I
just call 'otherFunc()', ignore the return value and then add to
'globalSum' then the result is correct.
An example of run version that works:
void run()
{
foreach(int k; 0 .. numAddition) {
otherFunc();
globalSum += index;
writefln("DerivedFiber(%d) iteration %d globalSum is
%d", index, k, globalSum);
}
}
An example of run version that breaks (exactly like the one from
my previous mail):
void run()
{
foreach(int k; 0 .. numAddition) {
globalSum += otherFunc();
writefln("DerivedFiber(%d) iteration %d globalSum is
%d", index, k, globalSum);
}
}
Maybe this can help you understand something ...
Thanks,
Liran