Can't pickle when using multiprocessing Pool.map()

后端 未结 12 1794
醉梦人生
醉梦人生 2020-11-22 00:19

I\'m trying to use multiprocessing\'s Pool.map() function to divide out work simultaneously. When I use the following code, it works fine:

12条回答
  •  臣服心动
    2020-11-22 00:59

    You could also define a __call__() method inside your someClass(), which calls someClass.go() and then pass an instance of someClass() to the pool. This object is pickleable and it works fine (for me)...

提交回复
热议问题