2010-02-19 Rodrigo Kumpera <rkumpera@novell.com>
[mono.git] / mono / tests / assembly-load-stress.cs
blobceba7ccf9fdf77780934cdde42a4fb6fb2cb8fdd
1 using System;
2 using System.Text;
3 using System.Globalization;
4 using System.Collections.Generic;
5 using System.Reflection;
6 using System.Threading;
7 using System.IO;
9 public class Tests
11 static int nloops = 1;
12 static int nthreads = 10;
14 public static void Main (String[] args) {
15 if (args.Length > 0)
16 nloops = int.Parse (args [0]);
17 if (args.Length > 1)
18 nthreads = int.Parse (args [1]);
20 for (int li = 0; li < nloops; ++li) {
21 Thread[] threads = new Thread [nthreads];
22 for (int i = 0; i < nthreads; ++i) {
23 threads [i] = new Thread (delegate () {
24 foreach (string s in Directory.GetFiles ("/usr/local/lib/mono/2.0", "*.dll")) {
25 AssemblyName.GetAssemblyName (s);
27 });
29 for (int i = 0; i < 10; ++i)
30 threads [i].Start ();