D
D
DDwrt1002019-11-11 11:04:52
Python
DDwrt100, 2019-11-11 11:04:52

How to implement parallel processing of list values?

Good afternoon, please tell me how to parallelize the processing of the list (English list).
The situation is this, after the initial processing I have a list with about 2500 values ​​in it.
Then the list is passed to a function that sequentially calculates the results. In one thread, the calculation is slow, more than 5 minutes.
I want to try to calculate this list in parallel.
The question is, before parallelizing, do I need to divide the sheet into 3-4 parts? Or can Pyhton somehow determine itself that the list is being used in a parallel computation and shared by an internal process?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey Tikhonov, 2019-11-11
@tumbler

Read the documentation on multiprocessing, there such and such an option is possible.

V
Vadim Shatalov, 2019-11-11
@netpastor

https://docs.python.org/3/library/concurrent.futur...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question