2 using System
.Threading
;
5 This test stresses the interaction of the multiple suspend sources and stop-the-world.
7 Right now the current iteraction that we stresses is between the domain unloader and
8 sgen STW. It's mighty hard to get this right on mach.
13 static void AllocStuff ()
15 var x
= new object ();
16 for (int i
= 0; i
< 300; ++i
)
20 static void BackgroundNoise ()
29 static void AppDomainBackgroundNoise ()
31 for (int i
= 0; i
< 3; ++i
) {
32 var t
= new Thread (BackgroundNoise
);
33 t
.IsBackground
= true;
39 for (int i
= 0; i
< 3; ++i
) {
40 var t
= new Thread (BackgroundNoise
);
41 t
.IsBackground
= true;
45 for (int i
= 0; i
< 100; ++i
) {
46 var ad
= AppDomain
.CreateDomain ("domain_" + i
);
47 ad
.DoCallBack (new CrossAppDomainDelegate (AppDomainBackgroundNoise
));
49 AppDomain
.Unload (ad
);
51 if (i
> 0 && i
% 20 == 0) Console
.WriteLine ();
53 Console
.WriteLine ("\ndone");