Python多处理pool.apply_async在Windows上不返回结果

时间:2020-05-21 13:06:52

标签: windows python-multiprocessing

在Windows上运行时,我的算法有问题。由于我的脚本很长,所以这是我代码的重要部分:

`

import multiprocessing
#efficient_apriori- This module implements the Apriori algorithm
import efficient_apriori
global process
process=4
def Son_Algorithm(k):
    .......
    ......
if __name__ == "__main__":
    result_first_pass=[]
    pool = multiprocessing.Pool(process)
    result_first_pass = [pool.apply_async(Son_Algorithm, args=(i,)) for i in range(process)]
    print("first pass",   result_first_pass)
    print('results',[result.get(timeout=10) for result in result_first_pass])

    pool.close()
    pool.join() 

`

我总是得到错误的结果: here 我的问题类似于this,但答案无法解决问题:

0 个答案:

没有答案