what’s the difference between background, foreground & main threads? What are the diff types of threads in .NET?
what’s the difference between background, foreground & main threads? What are the diff types
Share
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.
A background thread (whose Thread object has the
Backgroundproperty set totrue) willnot prevent an application from quitting.
Once all normal(foreground) threads have exited, any running background threads are immediately terminated.
In addition, if an AppDomain is unloaded, all background threads in the AppDomain are immediately aborted.
The threads managed by the ThreadPool are background threads.
A foreground thread is an ordinary thread.
The main thread is the initial thread that started the program. (The thread running the
Mainmethod)For more information, see here.