How can I recover the return value of a function passed to multiprocessing.Process?

前端 未结 12 1779
野的像风
野的像风 2020-11-22 07:36

In the example code below, I\'d like to recover the return value of the function worker. How can I go about doing this? Where is this value stored?

12条回答
  •  一整个雨季
    2020-11-22 08:05

    It seems that you should use the multiprocessing.Pool class instead and use the methods .apply() .apply_async(), map()

    http://docs.python.org/library/multiprocessing.html?highlight=pool#multiprocessing.pool.AsyncResult

提交回复
热议问题