Max added the comment:

Somewhat related is this statement from Programming Guidelines:

> When using the spawn or forkserver start methods many types from 
> multiprocessing need to be picklable so that child processes can use them. 
> However, one should generally avoid sending shared objects to other processes 
> using pipes or queues. Instead you should arrange the program so that a 
> process which needs access to a shared resource created elsewhere can inherit 
> it from an ancestor process.

Since on Windows, even "inheritance" is really the same pickle + pipe executed 
inside CPython, I assume the entire paragraph is intended for UNIX platform 
only (might be worth clarifying, btw).

On Linux, "inheritance" works faster, and can deal with more complex objects 
compared to pickle with pipe/queue -- but it's equally true whether it's 
inheritance through global variables or through arguments to the target 
function. There's no reason 

So the text I proposed earlier wouldn't conflict with this one. It would just 
encourage programmers to use function arguments instead of global variables: 
because it's doesn't matter on Linux but makes the code portable to Windows.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue29795>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to