python - ThreadPoolExecutor number of threads -
i trying use threadpoolexecutor in python using futures backport package. however, problem threads executed @ same time there no actual pooling take place. more 10 threads of function instead of 5 , others. use following code find wrong or backported implementation? thank you!
with threadpoolexecutor(max_workers=5) executor: futures = [executor.submit(f, x, y) t in range(10)] future in as_completed(futures): self.trees.append(future.result())
Comments
Post a Comment