Is there a way to access NewExpressionStore from within a parallelized calculation? I have tried variations of
Module[{x = "a", s = Language`NewExpressionStore["store"]},
s["put"[x, "value", 1]]; SetSharedVariable[s];
ParallelMap[Print[s["get"[#, "value"]]] &, {x, x}];]
(*
Language`ExpressionStore::nostore : -- Message text not found -- (Language`ExpressionStore[store])
Language`ExpressionStore::nostore : -- Message text not found -- (Language`ExpressionStore[store])
Null
Null
*)
The sequential equivalent prints two 1 as expected.
Module[{x = "a", s = Language`NewExpressionStore["store"]},
s["put"[x, "value", 1]]; Map[Print[s["get"[#, "value"]]] &, {x, x}];]
(*
1
1
*)
AssociationorHashTablefor this purpose. – Jason B. Jul 17 '18 at 13:31