2 using System
.Threading
;
5 static int count
= 20000;
7 static int threads
= 10;
8 static object global_obj
;
9 static void stress_loop () {
10 object obj
= new object ();
12 object [] array
= new object [count
];
13 for (int i
= 0; i
< count
; ++i
) {
14 array
[i
] = new object ();
16 for (int i
= 0; i
< count
; ++i
) {
18 global_obj
= new String ('x', 32);
20 array
[i
] = global_obj
;
26 for (int i
= 0; i
< count
; ++i
) {
30 // two times, with feeling
31 for (int i
= 0; i
< count
; ++i
) {
33 for (int j
= 0; i
< count
; ++i
) {
42 static void worker () {
43 for (int i
= 0; i
< loops
; ++i
)
46 static void Main (string[] args
) {
48 loops
= int.Parse (args
[0]);
50 count
= int.Parse (args
[1]);
52 threads
= int.Parse (args
[2]);
53 for (int i
= 0; i
< threads
; ++i
) {
54 Thread t
= new Thread (new ThreadStart (worker
));
57 /* for good measure */