Python Multi-Processing

Code speaks:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
from multiprocessing import Pool
cplexProcessPool = Pool(processes=program_process_number)
cplexPoolResult = []
for variable in variableList:
    cplexPoolResult.append(cplexProcessPool.apply_async(multi_processing_function, args= (arg1, arg2, arg3)))
cplexProcessPool.close()
cplexProcessPool.join()

results = []
for res in cplexPoolResult:
    results.append(res.get())
results = [x for x in results if x is not None]
print(str(results))
Built with Hugo
Theme Stack designed by Jimmy