Re: Relationship between Application.Exit() and AppDomain
- From: jetan@xxxxxxxxxxxxxxxxxxxx ("Jeffrey Tan[MSFT]")
- Date: Thu, 17 Apr 2008 08:33:09 GMT
Hi Willy ,
This sounds like a promising explanation. Thank you for the sharing.
However, from principle, I am still a bit hard to understand it. The
started worker threads should run under the same priority as the GUI
threads. Even on the single-core CPU, OS kernel thread schedular will give
each thread the same time slice as long as these threads are in the same
priority. It is hard for me to understand why the CPU gives not enough time
to the GUI thread to call Thread.Abort() method.
Furthermore, if I remember correctly, the CPU will boost the UI thread's
priority making it more user friendly. So the GUI thread should have higher
priority(at least a small period) to execute the Thread.Abort() method.
Additionally, since the Thread.Abort() will cause the user-mode to
kernel-mode transition with stack-unwind which are both very consuming, I
suspect if this is another important factor for AppDomain.Unload() expires.
Anyway, I agree that real-world seldom causes this problem. Catching this
CannotUnloadAppDomainException and call AppDomain.Unload() again should
resolve this problem.
Best regards,
Jeffrey Tan
Microsoft Online Community Support
=========================================
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msdnmg@xxxxxxxxxxxxxx
This posting is provided "AS IS" with no warranties, and confers no rights.
.
- Follow-Ups:
- Re: Relationship between Application.Exit() and AppDomain
- From: Willy Denoyette [MVP]
- Re: Relationship between Application.Exit() and AppDomain
- References:
- Relationship between Application.Exit() and AppDomain
- From: Sunny S
- Re: Relationship between Application.Exit() and AppDomain
- From: Scott M.
- Re: Relationship between Application.Exit() and AppDomain
- From: Jon Skeet [C# MVP]
- Re: Relationship between Application.Exit() and AppDomain
- From: Sunny S
- Re: Relationship between Application.Exit() and AppDomain
- From: Willy Denoyette [MVP]
- Re: Relationship between Application.Exit() and AppDomain
- From: Sunny S
- Re: Relationship between Application.Exit() and AppDomain
- From: Willy Denoyette [MVP]
- Re: Relationship between Application.Exit() and AppDomain
- From: Sunny S
- Re: Relationship between Application.Exit() and AppDomain
- From: Willy Denoyette [MVP]
- Re: Relationship between Application.Exit() and AppDomain
- From: Sunny S
- Re: Relationship between Application.Exit() and AppDomain
- From: Jeffrey Tan[MSFT]
- Re: Relationship between Application.Exit() and AppDomain
- From: Sunny S
- Re: Relationship between Application.Exit() and AppDomain
- From: "Jeffrey Tan[MSFT]"
- Re: Relationship between Application.Exit() and AppDomain
- From: Sunny S
- Re: Relationship between Application.Exit() and AppDomain
- From: Willy Denoyette [MVP]
- Re: Relationship between Application.Exit() and AppDomain
- From: Sunny S
- Re: Relationship between Application.Exit() and AppDomain
- From: "Jeffrey Tan[MSFT]"
- Re: Relationship between Application.Exit() and AppDomain
- From: Willy Denoyette [MVP]
- Relationship between Application.Exit() and AppDomain
- Prev by Date: Re: Relationship between Application.Exit() and AppDomain
- Next by Date: Re: Relationship between Application.Exit() and AppDomain
- Previous by thread: Re: Relationship between Application.Exit() and AppDomain
- Next by thread: Re: Relationship between Application.Exit() and AppDomain
- Index(es):
Relevant Pages
|