Hi Omkaraaa,
>> if above code is will give consistent thread names.
It will give different names based on “i” parameter.
>> Is there any reusing of threads happens internally?
Yes, it will reuse the threads when previous threads finished.
>> Is it fine to write such code. And does it affect when lot of threads will get created
Thread.Name property is write-once, you will receive exception when you try to set name for a thread whose name already set.
For your above code, it will throw exception when it reuses previous thread and set the name property.
Best Regards,
Tao Zhou
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to
MSDN Support, feel free to contact MSDNFSF@microsoft.com.