Sign In
Neeraj Agrawal
Translate This Page
Translate this page
Powered by
Microsoft® Translator
Options
Blog Home
About
Email Blog Author
Share this
RSS for posts
Atom
RSS for comments
Search
Advanced search options...
Search In:
Everything
Blogs
Forums
People
Groups
Places
Pages
Date range:
All Time
Last Year
Last 6 Months
Last 3 Months
Last Month
Last Week
Last Two Days
Tags
No tags have been created or used yet.
Archive
Archives
March 2009
(1)
May 2008
(2)
February 2008
(1)
October 2006
(1)
April 2006
(1)
January 2006
(1)
September 2005
(1)
August 2005
(1)
Why doesn't my process terminate even after main thread terminated
MSDN Blogs
>
Neeraj Agrawal
>
Why doesn't my process terminate even after main thread terminated
Why doesn't my process terminate even after main thread terminated
NeerajAg
4 Sep 2005 1:12 PM
Comments
3
Sometimes you may wonder why your .NET application didn't terminated even after the main thread is terminated. Infact I was boggled with this problem for some time.
Finally I figured out that .NET does not terminates a process on the termination of main thread if there are other threads running. The new definition for determining process abortion is as follows:
"Once all foreground threads belonging to a process have terminated, the common language runtime ends the process by invoking 'Abort' on any
background
threads that are still alive"
This means that if you want your application to exhibit the same behavior (as I was expecting [:)]), make sure that you set all the threads background property to
true
(except for main thread). For complete details on this thread property, follow
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemthreadingthreadclassisbackgroundtopic.asp
3 Comments
Blog - Comment List MSDN TechNet
Comments
Loading...
Leave a Comment
Name
Comment
Please add 1 and 2 and type the answer here:
Post