i am working in sagemath doing some calculation and the process need to return a big array of numbers (the numbers in the array are RealField , for bigger precision) .I have work with thread librarie in c++ but in python i can't figure out how to implement it . i know that Queue() is limited in size `
import multiprocessing as mp
def foo(x):
list=[]
for i in range(0,1000000000):
data=1
#do something to data
list.append(data)
return list# retriev the data from process somehow
if __name__ =="__main__":
cores=4
threads=[]
for i in range(0,cores):
threads.append(mp.Process(target=foo,args=(100)))
for i in range(0,cores):
threads[i].start()
for i in range(0,cores):
threads[i].join()
#the system to retriev data
`
i just need a way to return anything from process. An example would be even better
i tried Queue but after a size it's fails me . I have found this Python multiprocessing on windows with large arrays but i don't know how to modify for my problem
edit: i have write the code , the process is running as it shoud