Is it possible to reuse python thread object to avoid unnecessary creation of the thread? It could be useful in the following situation. There are many tasks which must be parallelized using thread pool which size is much less than the number of the tasks.
I know that there is multiprocessing.Pool, but it is very important to use threads not processes.
If you're using Python 3, the best way is definetly to use concurrent.futures.ThreadPoolExecutor.
Actually you should read the whole documentation of concurrent.futures, it's not long, and there are many great examples.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With