111,092
社区成员




class Program class Program
{
static void Main(string[] args)
{
Thread a = new Thread(ThreadAFuncion);
a.Start();
ThreadTest(out testnum);
}
static int testnum = 10000;
static void ThreadAFuncion()
{
Console.WriteLine("Start");
while (testnum > 0)
{
Console.WriteLine("Thread:"+ testnum.ToString());
}
}
static void ThreadTest(out int aaa)
{
aaa = 10000;
while (true)
{
aaa--;
Thread.Sleep(100);
}
}
class Program
{
static void Main(string[] args)
{
Thread a = new Thread(ThreadAFuncion);
a.Start();
ThreadTest(out testnum);
}
static int testnum = 10000;
static void ThreadAFuncion()
{
Console.WriteLine("Start");
while (testnum > 0)
{
Console.WriteLine("Thread:"+ testnum.ToString());
}
}
static void ThreadTest(out int aaa)
{
aaa = 10000;
while (true)
{
aaa--;
Thread.Sleep(100);
}
}
static int a = 1;
static void Main(string[] argv)
{
ThreadPool.QueueUserWorkItem(p =>
{
while (true)
{
Console.WriteLine(a);
Thread.Sleep(500);
}
});
Proc(out a);
}
private static void Proc(out int a)
{
var ram = new Random();
while (true)
{
Thread.Sleep(200);
a = ram.Next(1000);
}
}