-
-
Save Crispy13/c3acaef979ed93567f5e14e1b34add47 to your computer and use it in GitHub Desktop.
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 | |
import foo | |
def py_func(chr_pos:list, rbt:tuple): | |
return (rbt[0], rbt[1] * 2) | |
def main(): | |
chr_pos_vec = list(map(lambda x:[x[0].__str__(), x[1].__str__()], zip(["foo","bar", "RDJ","PointBreak"], [121593746, 43114490, 43112962, 8058443]))) | |
rbt = [("Doodle", 2), ("Noodle", 3)] | |
rr = foo.test(chr_pos_vec, rbt) | |
print("rr done.") | |
pr = [] | |
for r in rbt: | |
py_func.__defaults__ = (r,) | |
with multiprocessing.Pool(4) as pool: | |
pr.extend(pool.map( | |
py_func, | |
chr_pos_vec, | |
)) | |
import gc | |
gc.collect() | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment