How can l launch each worker in a multiprocessing.Pool in a new shell?

梦想的初衷 提交于 2019-12-04 19:20:46

Try using the Queue the other way around.

Let the workers put messages into the Queue, and in the parent process get them from the Queue and print them. That should get rid of intermingled output.

If you want to pass messages both from parent to workers and back, use two queues. One for passing messages to workers, and one to pass messages back to the parent.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!