Reduce TLS accesses. (#11487)
[mono-project.git] / mono / tests / assembly-load-stress.cs
blob462ccfb8e318f262e74c65e59c0dec17b9f10d90
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/4.5", "*.dll")) {
25 AssemblyName.GetAssemblyName (s);
27 });
29 for (int i = 0; i < 10; ++i)
30 threads [i].Start ();