New answers tagged parallel
3
This non-answer (addressing Szabolcs' observation) won't fit in a comment.
The following makes me suspect that the problem has something to do with how the parallel kernels are representing data internally:
LaunchKernels[];
datatest = Table[rule[x, x], {2}];
data = Table[Rule[x, x], {2}];
Trace[datatest]
(* ==> {datatest,{rule[x,x],rule[x,x]}}*)
...
7
To answer your actual question, SetSharedVariable does not allow simultaneous reads. It forces the variable to be evaluated on the main kernel, effectively disabling the parallelization.
A more interesting question for me is: why is ParallelMap so slow when not using SetSharedVariable? This observation is not an answer but it's too long for a comment.
...
Top 50 recent answers are included