Skip to content

Instantly share code, notes, and snippets.

@tomMoral
Created October 17, 2016 08:22
Show Gist options
  • Save tomMoral/c75824eea5b3f68fd2148c64d1ee88fa to your computer and use it in GitHub Desktop.
Save tomMoral/c75824eea5b3f68fd2148c64d1ee88fa to your computer and use it in GitHub Desktop.
Test file for multiprocessing Manager list
import multiprocessing as mp
from multiprocessing import Manager
def test(idx, list_out):
list_out.append(idx)
if __name__ == '__main__':
mgr = Manager()
list_out = mgr.list()
jobs = []
for i in range(3):
p = mp.Process(target=test, args=(i, list_out))
jobs.append(p)
p.start()
for proc in jobs:
proc.join()
print(list_out)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment