This is a followup question to this one. Following the comment, I used the code in this answer in this way:
ClearAll["Global`*"]
j = Reap[Do[{Sow[{i, i}, a]}; Sow[{i, i^2}, b], {i, 100}], _, Rule];
lista1 = a /. Last@j;
lista2 = b /. Last@j;
ListPlot[{lista1, lista2}]
ParallelEvaluate[foo = {}];
ParallelEvaluate[f1 = {}];
sow[x_] := (foo = {foo, x});
sow1[x_] := (f1 = {f1, x});
ParallelDo[sow[{i, i}]; sow1[{i, i^2}], {i, 100}];
lista11 = Join @@ ParallelEvaluate[Flatten@foo];
lista22 = Join @@ ParallelEvaluate[Flatten@f1];
ListPlot[{lista11, lista22}]
The problem is that the plots I obtain in the two cases are different. What did I do wrong?
I suspect it has to do with the use of Flatten, but I could not get it to work properly.