Title: Documentation improvement proposal for multiprocessing
Type: Stage:
Components: Documentation Versions: Python 3.10, Python 3.9, Python 3.8
Status: open Resolution:
Dependencies: Superseder:
Assigned To: docs@python Nosy List: bombs-kim, docs@python, xtreak
Priority: normal Keywords:

Created on 2018-05-17 07:15 by bombs-kim, last changed 2020-06-28 08:28 by terry.reedy.

Messages (2)
msg316892 - (view) Author: bombs (bombs-kim) * Date: 2018-05-17 07:15
>>> from multiprocessing import Pool
>>> p = Pool(5)
>>> def f(x):
...     return x*x
>>>, [1,2,3])

This example in the document is confusing because this is already wrong code when run with fork method even if you run it as a script. With fork start method, f should be defined before p is created.

Also, just advising that one shouldn't use interactive shell and should run multiprocessing code in if __name__ == '__main__' is not informative becuase those conditions are generally no problem with fork method.

Can I try improving the documentation?
msg316893 - (view) Author: bombs (bombs-kim) * Date: 2018-05-17 07:17

here is the link to the document.
Date User Action Args
2020-06-28 08:28:26terry.reedysetversions: + Python 3.9, Python 3.10
2018-09-23 16:01:54xtreaksetnosy: + xtreak
2018-05-17 07:17:49bombs-kimsetmessages: + msg316893
2018-05-17 07:16:56bombs-kimsettitle: possible documentation improvement proposal for multiprocessing -> Documentation improvement proposal for multiprocessing
2018-05-17 07:15:18bombs-kimcreate