Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Looks like it is indeed just one thread per CLR instance within the process - at the moment, anyway. Here's some code to show that:</p> <p>Test.cs:</p> <pre><code>using System; class Test { static void Main() { AppDomain.CreateDomain("First") .ExecuteAssembly("ShowFinalizerThread.exe"); AppDomain.CreateDomain("Second") .ExecuteAssembly("ShowFinalizerThread.exe"); } } </code></pre> <p>ShowFinalizerThread.cs:</p> <pre><code>using System; using System.Threading; class ShowFinalizerThread { static Random rng = new Random(); ~ShowFinalizerThread() { Console.WriteLine("Thread/domain: {0}/{1}", Thread.CurrentThread.ManagedThreadId, AppDomain.CurrentDomain.FriendlyName); if (rng.Next(10) == 0) { Console.WriteLine("Hanging!"); Thread.Sleep(2000); } } static void Main() { new Thread(LoopForever).Start(); } static void LoopForever() { while (true) { new ShowFinalizerThread(); GC.Collect(); GC.WaitForPendingFinalizers(); Thread.Sleep(300); }; } } </code></pre> <p>Compile each as a console app, then run test.exe (from the command line is easiest, IMO). You'll see that one app domain's finalizer blocks another.</p> <p>In the future I wouldn't be surprised to see one finalizer thread per <em>core</em> rather than per AppDomain - but it sounds like you'll still have problems :(</p> <p>You have my deepest sympathy (though not a solution) - once I tracked down a deadlock in an Oracle Blob. We were able to fix that by disposing of it properly, but I know not everything works that nicely - and it was a real pain even finding that one!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload