Folgendes Verhalten hab' ich:
Es gibt keinerlei Ausgabe und auch keine Terminierung. Dafür aber eine stetig wachsende Anzahl von pythonw-Prozessen bis der Rechner unbedienbar ist.

- das kann also gar nicht funktionieren.docs.python.org hat geschrieben:Functionality within this package requires that the __main__ module be importable by the children. This is covered in Programming guidelines however it is worth pointing out here. This means that some examples, such as the multiprocessing.Pool examples will not work in the interactive interpreter.
Code: Alles auswählen
from multiprocessing import Pool
def f(x):
return x*x
if __name__ == "__main__":
p = Pool(5)
p.map(f, [1,2,3])