Solved

attach thread to main process.

Posted on 2004-09-06
2
354 Views
Last Modified: 2006-11-17
How can I add  a thread to the existing process. So for instance, if I do the following

// thread created from main application.
Thread alarmTimer = new Thread(new ThreadStart(alarmEventHandler));
alarmTimer.Start();
alarmTimer.Join(0);

then the alarmTimer thread is not destroyed when the main process or application is destroyed... So what I want to happen is to be able to create a separate thread but have it terminate when the main thread or process or application that it was created from terminates? So imagine you have a windows form and create a thread from it, then you would want this new thread to terminate when the form terminates...
0
Comment
Question by:dotnet22
2 Comments
 
LVL 37

Accepted Solution

by:
gregoryyoung earned 500 total points
ID: 11991089
0
 

Author Comment

by:dotnet22
ID: 11992152
Thanks.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now