I'm a newbee for multiprocess
and try with a multiprocess
demo in python.
from multiprocessing import Pool
def foo(a, b):
print(a,b)
...
def bar(a, b):
print(a,b)
...
if __name__ == '__main__':
pool = Pool(processes=2)
func_list = [foo, bar]
for func in func_list:
pool.apply_async(func, (1, 2))
pool.close()
pool.join()
print(123)
When I work with win32
platform
123
output always be 3
times
123
1 2
1 2
123
123
But when try this demo with linux
it output once
1 2
1 2
123
Why this print execute 3 times out of main block in python Window?