Created
October 17, 2016 08:22
-
-
Save tomMoral/c75824eea5b3f68fd2148c64d1ee88fa to your computer and use it in GitHub Desktop.
Test file for multiprocessing Manager list
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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