I am using ThreadPool to execute a set of tasks in a windows service. The service spawns new threads every 10seconds. I would like to record the name of the thread that picked up a particular task from the database. Is it possible to get the name of the thread?
I am using ThreadPool to execute a set of tasks in a windows service.
Share
I don’t know if ThreadPool threads are assigned a meaningful Name, but you should always be able to use the ManagedThreadId of the CurrentThread for debugging/logging purposes.