using System;
using System.Threading;namespace ConsoleApplication1
{
class SimpleThreadDemo
{
static void Main(string[] args)
{
Thread t1 = new Thread(new ThreadStart(TaskOne));
Thread t2 = new Thread(new ThreadStart(TaskTwo));
t1.Start();
t2.Start();
t2.Priority = ThreadPriority.Highest;
}
static void TaskOne()
{
for(int count = 1; count <= 10 ; count++)
{
Console.WriteLine(count * 2);
}
}
static void TaskTwo()
{
for (int i = 5000; i >4990 ; i--)
{
Console.WriteLine(i);
}
}
}}
using System.Threading;namespace ConsoleApplication1
{
class SimpleThreadDemo
{
static void Main(string[] args)
{
Thread t1 = new Thread(new ThreadStart(TaskOne));
Thread t2 = new Thread(new ThreadStart(TaskTwo));
t1.Start();
t2.Start();
t2.Priority = ThreadPriority.Highest;
}
static void TaskOne()
{
for(int count = 1; count <= 10 ; count++)
{
Console.WriteLine(count * 2);
}
}
static void TaskTwo()
{
for (int i = 5000; i >4990 ; i--)
{
Console.WriteLine(i);
}
}
}}
解决方案 »
- 新手请教:C# 实现访问服务器
- 关于winform的dateGridView问题(Vs2008)
- DataGridViewCheckBoxColumn绑定int列的问题
- C#中没有像Java中的内置的Observer类或Observer接口?在线,知道后立即结分。
- c#语言,在vs2005中,怎么让access中的数据显示在DataGridView中?
- 帮忙看一段C#代码,谢谢
- 用C#怎样获取磁盘分区剩余容量?
- 我们是做DELPHI的,公司是网络公司,老板今天要我们转NET,问有哪些比较好的资源的.net网站
- 有几个问题,是在wrox的《visual C#入门经典》里的练习题,不是很清楚该怎么做,那位朋友能告诉一下?
- 视频监控中的双击单屏放大,再双击返回,一般是怎么做的
- 求教:为什么要用CallContext,CallContext到底是什么呢
- 我在gridview的列中增加了一个select按钮,每次选择进行写入操作,可是总写2次
t1.Start();
t2.Start();
换个位置,不然优先级还没设,线程1都已经开始跑了