我需要这个结果:
t0 = core 0 Loaded with process 0
t1 = core 1 Loaded with process 1
t2 = core 2 Loaded with process 2
t3 = core 0 Free // a serial processing for each core
t4 = core 0 Loaded with process 3
t5 = core core 1 Free
.... according process 0,1,2,3 takes, in theory the same time on any core
没有p.join()
我得到:
t0 = core 0 Loaded with process 0
t1 = core 1 Loaded with process 1
t2 = core 2 Loaded with process 2
t4 = core 0 Loaded with process 3 // two process on core 0
t5 = core 1 Loaded with process 4 // etc etc ...
我得到p.join()
:
t0 = core 0 Loaded with process 0
t1 = core 0 Free // that is not multiprocessing ...
t2 = core 1 Loaded with process 1
t3 = core 1 Free
t4 = core 2 Loaded with process 2
t5 = core 2 Free
我正在寻找一个if !p.busy()
......喜欢或其他什么。目的是将单个进程图像大小调整程序转换为多进程程序。
p.join()
来自
p = Process(target=fonction, args=((process_id),filearg[file],t0))
p.start()
p.join()