Re: Relationship between Application.Exit() and AppDomain

Tech-Archive recommends: Fix windows errors by optimizing your registry



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.


.



Relevant Pages

  • [ckpatch][3/29] 2.6.17-smpnice-staircase-16
    ... Implement the "staircase" hybrid foreground-background single priority ... array cpu scheduler policy. ... extern struct user_struct root_user; ... goto out_running; ...
    (Linux-Kernel)
  • [RFC][PATCH] O(1) Entitlement Based Scheduler
    ... This patch is a modification of the Oscheduler that introduces ... _entitlement_ to CPU resources that is determined by the number of _shares_ ... This patch provides both soft and hard CPU usage rate caps per ... one getting the most can be given a better priority, ...
    (Linux-Kernel)
  • [ANNOUNCE] RSDL completely fair starvation free interactive cpu scheduler
    ... Staircase DeadLine" cpu scheduler. ... A novel design which incorporates a foreground-background descending priority ... the cpu that it is queued onto also keeps a record of that quota. ... run at this runqueue's current priority rotation. ...
    (Linux-Kernel)
  • Re: [ANNOUNCE] RSDL completely fair starvation free interactive cpu scheduler
    ... Staircase DeadLine" cpu scheduler. ... A novel design which incorporates a foreground-background descending priority ... the cpu that it is queued onto also keeps a record of that quota. ... task uses up its quota it is decremented one priority level. ...
    (Linux-Kernel)
  • [PATCH] [RSDL-mm 6/6] sched: document rsdl cpu scheduler
    ... Add comprehensive documentation of the RSDL cpu scheduler design. ... +A novel design which incorporates a foreground-background descending priority ... +the cpu that it is queued onto also keeps a record of that quota. ...
    (Linux-Kernel)