System.Threading.Timer stateTimer1;
AutoResetEvent autoEvent1 = new AutoResetEvent(true);
TimerCallback timerDelegate1; timerDelegate1 = new TimerCallback(MyInvokeXiancheng1);
stateTimer1 = new System.Threading.Timer(timerDelegate1, autoEvent1, 100, 5000);请问用多个System.Threading.Timer进行数据的采集,最后会调用同一个数据处理函数,多个时钟对这个函数的执行会互相干扰吗.这个函数有全局计数变量,记录处理次数,怎么控制这个全局变量不受别的线程影响啊
AutoResetEvent autoEvent1 = new AutoResetEvent(true);
TimerCallback timerDelegate1; timerDelegate1 = new TimerCallback(MyInvokeXiancheng1);
stateTimer1 = new System.Threading.Timer(timerDelegate1, autoEvent1, 100, 5000);请问用多个System.Threading.Timer进行数据的采集,最后会调用同一个数据处理函数,多个时钟对这个函数的执行会互相干扰吗.这个函数有全局计数变量,记录处理次数,怎么控制这个全局变量不受别的线程影响啊
解决方案 »
- 请问ASP.NET如何制作网站多风格选择?
- 将参数值从 String 转换到 Decimal 失败。
- asp.net导出EXCEL问题
- GridView中的一个DropDownList设为AutoPost,在AutoPost事件中有没有办法知道点击的是哪一行的DropDownList?
- 点击超链接 怎么样做到 显示两个不同表的内容
- 在gridview中的checkbox的问题
- 我要在dataview中过滤这样的内容,该怎么做?
- 这个功能不知怎么实现,希望能找办法?
- 关于图片验证码的奇怪问题,在线等!
- 情况紧急,请帮忙!谢谢!!
- 日期如何计算?
- 怎么在OnItemCommand中获取前台的input呢?
{
object[] paras = new object[1];//参数传递
paras[0] = "1";
this.Invoke(new Xiancheng1Delegate(InsertData), paras);
}