4 using System.Threading;
8 class ThreadPoolLauncherObject
10 public volatile int i = 0;
12 public ThreadPoolLauncherObject ()
14 ThreadPool.QueueUserWorkItem (_ => { for (int i = 0; i < 10 * 1000 * 1000; ++i); }, null);
18 public static void Main ()
21 object o = new object ();
24 Enumerable.Range (0, 100)
25 .AsParallel ().WithDegreeOfParallelism (Environment.ProcessorCount)
29 ad = AppDomain.CreateDomain ("testdomain" + i);
30 ad.CreateInstance (typeof (ThreadPoolLauncherObject).Assembly.FullName, typeof (ThreadPoolLauncherObject).FullName);
34 AppDomain.Unload (ad);