I have problems to write parallel code in mathematica. Why is
candidates = {};
SetSharedVariable[candidates];
Do[
ParallelDo[
eq = RandomReal[] + RandomReal[];
AppendTo[candidates, eq]
, {j, 1, 1000}]
, {i, 1, 10}]
slower than the non parallel version
candidates = {};
Do[
Do[
eq = RandomReal[] + RandomReal[];
AppendTo[candidates, eq]
, {j, 1, 1000}]
, {i, 1, 10}]
?