In this lesson, you’ll refactor your previous code by using a thread pool executor from the concurrent.futures
module. If you download the sample code, you can get your own copy of 07-thread_pool.py
:
To learn more, you can also check out the documentation for concurrent.futures.ThreadPoolExecutor
and concurrent.futures.Executor.map
.
nightfury on Dec. 26, 2019
Hi,
Would this be a cool way to find the number of threads supported by an OS ? Out of my curiosity I modified the code a bit to see if it crashes beyond certain point
On my system (running mac OS) , the code crashes beyond max_workers=2048 with the following error
Any comments on whats happening here ?