When you plan your tasks using TaskCreationOptions.LongRunning , it starts in its thread, not in the thread from ThreadPool, so you can safely set the thread name.
Using this method is likely to affect performance, so I would suggest using it only during debugging. In addition, it seems that the number of threads created in this way is unlimited (except for the global restrictions on the number of threads), so it will not behave the same as without using this option.
svick source share