2 using System
.Threading
;
6 static bool done
= false;
8 static void Allocator (int n
)
10 //Console.WriteLine (n);
17 for (int i
= 0; i
< 10000; ++i
)
19 var o
= new object [12];
22 ThreadPool
.QueueUserWorkItem (_
=> Allocator (n
- 1));
25 static void LowLimits ()
27 ThreadPool
.SetMinThreads (1, 1);
28 ThreadPool
.SetMaxThreads (1, 1);
31 static void HighLimits ()
33 ThreadPool
.SetMaxThreads (1000, 1000);
34 ThreadPool
.SetMinThreads (100, 100);
37 public static void Main ()
40 var dones
= new bool [N
];
43 ThreadPool
.QueueUserWorkItem (_
=> Allocator (10000));
46 //Console.WriteLine ("new");
53 for (int i
= 0; i
< N
; ++i
)
57 ThreadPool
.QueueUserWorkItem (_
=> {
58 //Console.WriteLine ("done " + j);
68 for (int i
= 0; i
< N
; ++i
)