Advertisement

04.18.2008 at 12:02AM PDT, ID: 23333387
[x]
Attachment Details

Thread is not termination even after Thread.Abort operation...

Asked by deshaw in C# Programming Language

Tags: C#

Hi,

In my C# program i am termination thread by thread.Abort when times out occur. But i figured out that even after thread.Abort operation the thread is being alive for the random time. I have attached the code snippet for this.

Could anyone please tell me how can i terminate thread for sure.

ThanksStart Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
private void Delay() {
 //Thread waiting for the output stream of the process
 DateTime expireTime = DateTime.Now.AddSeconds(30);
 Thread outputThread = new Thread(new ThreadStart(ReadOutput));
 isApplicationTimedOut = false;
 outputThread.Start();
 while (outputThread.IsAlive) { 
     if(DateTime.Compare(expireTime,  DateTime.Now)<0) {
             outputThread.Abort();
             isApplicationTimedOut = true;
     }
  Application.DoEvents();
}
}
[+][-]04.18.2008 at 02:56AM PDT, ID: 21384410

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: C# Programming Language
Tags: C#
Sign Up Now!
Solution Provided By: GreenGhost
Participating Experts: 2
Solution Grade: A
 
 
[+][-]04.18.2008 at 07:41AM PDT, ID: 21386198

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.18.2008 at 09:59PM PDT, ID: 21391220

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.18.2008 at 10:00PM PDT, ID: 21391223

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]04.18.2008 at 10:16PM PDT, ID: 21391257

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.18.2008 at 10:36PM PDT, ID: 21391285

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.18.2008 at 11:21PM PDT, ID: 21391378

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.11.2008 at 06:06PM PDT, ID: 21987119

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]07.11.2008 at 06:11PM PDT, ID: 21987141

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.12.2008 at 11:14AM PDT, ID: 21989937

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.15.2008 at 03:42AM PDT, ID: 22005563

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]07.16.2008 at 08:20PM PDT, ID: 22022096

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_EXPERT_20070906