3 using System.Collections.Concurrent;
4 using System.Threading;
8 public static void Main ()
10 BlockingCollection<Thread> threads = new BlockingCollection<Thread> (new ConcurrentQueue<Thread> (), 128);
12 bool finished = false;
14 Thread gcThread = new Thread (() => {
21 Thread joinThread = new Thread (() => {
22 for (int i = 0; ; ++i) {
23 Thread t = threads.Take ();
27 if ((i + 1) % (50) == 0)
29 if ((i + 1) % (50 * 50) == 0)
37 for (int i = 0; i < 10 * 1000; ++i) {
38 Thread t = new Thread (() => { Thread.Yield (); });