How to give different names to ThreadPoolExecutor threads in Python

后端 未结 2 1464
抹茶落季
抹茶落季 2021-01-19 21:37

I have the below code for creating threads and running them.

from concurrent.futures import ThreadPoolExecutor
import threading


def task(n):
    result = 0         


        
2条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-19 22:13

    from the docs:

    New in version 3.6: The thread_name_prefix argument was added to allow users to control the threading.Thread names for worker threads created by the pool for easier debugging.

提交回复
热议问题