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

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

android - Keyboard hides my half of edit-text and button below it even in scroll view -

css - Make div keyboard-scrollable in jQuery Mobile? -