[issue20775] Modifications to global variables ignored after instantiating multiprocessing.Pool

2014-02-25 Thread Naftali Harris
New submission from Naftali Harris: Hi everyone, It appears that if you use a global variable in a function that you pass to Pool.map, but modify that global variable after instantiating the Pool, then the modification will not be reflected when Pool.map calls that function. Here's a short

[issue20775] Modifications to global variables ignored after instantiating multiprocessing.Pool

2014-02-25 Thread Ned Deily
Changes by Ned Deily n...@acm.org: -- nosy: +sbt ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20775 ___ ___ Python-bugs-list mailing list

[issue20775] Modifications to global variables ignored after instantiating multiprocessing.Pool

2014-02-25 Thread Tim Peters
Tim Peters added the comment: This is expected. global has only to do with the visibility of a name within a module; it has nothing to do with visibility of mutations across processes. On a Linux-y system, executing Pool(3) creates 3 child processes, each of which sees a read-only *copy* of

[issue20775] Modifications to global variables ignored after instantiating multiprocessing.Pool

2014-02-25 Thread Naftali Harris
Naftali Harris added the comment: Oh, ok, that makes a lot of sense. Thanks for the clear and patient explanation, Tim! Sorry to have bothered the Python bug tracker with this. --Naftali -- resolution: - invalid status: open - closed ___ Python