import multiprocessing
class multiprocessing_issue:
def __init__(self):
self.test_mp()
def print_test(self):
print "TEST TEST TEST"
def test_mp(self):
p = multiprocessing.Pool(processes=4)
p.apply_async(self.print_test, args=())
print "finished"
if __name__ == '__main__':
multiprocessing_issue()
I've set up a simple test above, create a class, call apply_async
with a function that should print "TEST TEST TEST"
. When I run this I see "finished"
printed, but it never prints "TEST TEST TEST"
as expected.
Can anyone see the error in this simple test case? I've set it up to reproduce the way I'm using it in my code.
Python 2.7 on Ubuntu