资 源 简 介
C# 多线程操作实例,获取指定进程的进程详细信息、获取指定进程的模块详细信息、创建无参数的多线程应用程序、创建带参数的多线程应用程序、创建共享线程模拟资源共享、创建子线程更新主线程数据等,部分代码分享如下:
if (MyThread.ThreadState == ThreadState.Terminated)
MyData += "
当前状态:已完成执行并已退出";
if (MyThread.ThreadState == ThreadState.Transition)
MyData += "
当前状态:在可以执行前等待处理器之外的资源";
if (MyThread.ThreadState == ThreadState.Unknown)
MyData += "
当前状态:状态未知";
if (MyThread.ThreadState == ThreadState.Wait)
MyData += "
当前状态:正在等待外围操作完成或等待资源释放";
if (MyThread.WaitReason == ThreadWaitReason.EventPairHigh)
MyData += "
等待原因:线程正在等待事件对高";
if (MyThread.WaitReason == ThreadWaitReason.EventPairLow)
MyData += "
等待原因:线程正在等待事件对低";
if (MyThread.WaitReason == ThreadWaitReason.ExecutionDelay)
MyData += "
等待原因:线程执行延迟";
if (MyThread.WaitReason == ThreadWaitReason.Executive)
MyData += "
等待原因:线程正在等待计划程序";
if (MyThread.WaitReason == ThreadWaitReason.FreePage)
MyData += "
等待原因:线程正在等待可用的虚拟内存页";
if (MyThread.WaitReason == ThreadWaitReason.LpcReceive)