Im looking to build a thread manager for an application.
I have already started threading and it works entirely fine but I would like to be able to programatically kill them or get information on them.
Does anyone have ideas?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You might look at
Thread.ThreadState,Thread.Interrupt(), andThread.Abort()(as Jon Skeet points out, this is not a preferred way to stop a thread).For a collection of all the threads running in your application, use
System.Diagnostics.Process.GetCurrentProcess().Threads.For more info, you might have a look at this example of a thread monitor.