Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from multiprocessing import Pool
- class Test(object):
- def __init__(self):
- self.array = []
- def task(self, n):
- self.array.append(n)
- print(self.array)
- def run(self):
- p = Pool(4)
- p.map(self.task, [1, 2, 3, 4])
- Test().run()
Add Comment
Please, Sign In to add comment