Hello Everyone,
I am trying to use the multiprocessing capabilities of python to launch Q function on a server. But it seems that the processes cannot run in parallel. Indeed, using 1 or more processes does not change the running time.
the code looks like this:
if __name__== ‘__main__’:
pool = mp.Pool(processes=3)
start_time = time.time()
results = [pool.apply_async(Launch_Data_Extraction, args=(x,)) for x in list_]
output = [p.get() for p in results]
print(time.time()-start_time)
And Launch_Data_Extraction looks like
def Launch_Data_Extraction(x):
hdb = qconnection.QConnection(host=, port=,username=, pandas=True)
DO STUFF
return
x would be individual orders for example, they only share the same initial data in the server. I am essentially trying to multi process a for-loop.
Am I doing something wrong ? Someone can help on this please ?
Thanks in advance,
Anas