I want to make one pool to run tasks which should follow the queue and the order.
import multiprocessing
import time
def func(msg):
for i in xrange(3):
print msg
time.sleep(2)
if __name__ == "__main__":
pool = multiprocessing.Pool(processes=1)
for i in xrange(10):
msg = "hello %d" %(i)
pool.apply_async(func, (msg, ))
pool.close()
time.sleep(50);
print "Sub-process(es) done."
It can print something. However there are not come up one by one. It will be done all immediately