Hello
Two questions, I want to give a thread a name and retrieve it to check whether it is alive how to do that?
I want to do that in asp.net application at BLL layer so I don't have a timeout exception. Is that a bad idea?
Thanks
Hello
Two questions, I want to give a thread a name and retrieve it to check whether it is alive how to do that?
I want to do that in asp.net application at BLL layer so I don't have a timeout exception. Is that a bad idea?
Thanks
1) The System.Thread type has a string Name property. You can use that.
2) I think more information is needed to answer the second question. It would be better if you remove this from this question and ask it as a seperate question to be discussed in isolation.
I know that System.Thread is having a name, but asp.net application is stateless I can't have a reference to it, the problem also I can't use the name because ProcessThread does not have a name.
foreach (ProcessThread thread in Process.GetCurrentProcess().Threads)
{
if (thread.Name == "Name") // does not work
{
}
}