• 大小: 0.55M
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2020-12-14
  • 语言: C#
  • 标签: 多线程  示例  C#  线程  

资源简介

原创C#多线程详细示例及PPT文档,适于教学和研发。希望对您有帮助 C# multi-threaded detailed examples and PPT documents, suitable for teaching and research and development. Want to help you

多线程示例
==========
1 PThreadDemo1 多线程示例
  理解:如无多线程,则阻塞相关应用

2 PThreadDemo2 多线程示例
  理解:多线程无序现象

3 PThreadDemo3  使用LOCK 示例

4 PThreadDemo4  使用 MONITOR 示例

5 PThreadDemo5  使用 AutoResetEvent 示例

6 PThreadDemo6  使用 ManualResetEvent 示例

7 PThreadDemo7  BackgroundWorker 后台线程示例

8 ThreadPool 线程池示例(微软)



资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
#region //
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
#endregion

using System.Threading; //

namespace PTheadDemo1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            Control.CheckForIllegalCrossThreadCalls = false;    //
        }

        clsForTh obj = new clsForTh();
        private void button1_Click(object sender EventArgs e)
        {
            obj.times = 10;
            doWithOutThread();
            //doWithThead();
            label1.Text = “END“;
        }
        private void doWithOutThread()
        { 
            obj.LoopMethod();
        }
   

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       9216  2009-12-14 09:57  PThreadDemo3\PThreadDemo3\bin\Debug\PTheadDemo2.exe

     文件      30208  2009-12-14 09:57  PThreadDemo3\PThreadDemo3\bin\Debug\PTheadDemo2.pdb

     文件      14328  2009-12-14 11:47  PThreadDemo3\PThreadDemo3\bin\Debug\PTheadDemo2.vshost.exe

     文件        490  2007-07-21 01:33  PThreadDemo3\PThreadDemo3\bin\Debug\PTheadDemo2.vshost.exe.manifest

     文件       2523  2009-12-14 09:59  PThreadDemo3\PThreadDemo3\Form1.cs

     文件       3111  2009-12-14 09:54  PThreadDemo3\PThreadDemo3\Form1.Designer.cs

     文件       5814  2009-12-14 09:54  PThreadDemo3\PThreadDemo3\Form1.resx

     文件        648  2009-12-14 09:39  PThreadDemo3\PThreadDemo3\obj\Debug\PTheadDemo2.csproj.FileListAbsolute.txt

     文件        847  2009-12-14 09:33  PThreadDemo3\PThreadDemo3\obj\Debug\PTheadDemo2.csproj.GenerateResource.Cache

     文件       9216  2009-12-14 09:57  PThreadDemo3\PThreadDemo3\obj\Debug\PTheadDemo2.exe

     文件        180  2009-12-14 09:54  PThreadDemo3\PThreadDemo3\obj\Debug\PTheadDemo2.Form1.resources

     文件      30208  2009-12-14 09:57  PThreadDemo3\PThreadDemo3\obj\Debug\PTheadDemo2.pdb

     文件        180  2009-12-14 09:29  PThreadDemo3\PThreadDemo3\obj\Debug\PTheadDemo2.Properties.Resources.resources

     文件       1314  2009-12-14 09:44  PThreadDemo3\PThreadDemo3\obj\Debug\PThreadDemo2.csproj.FileListAbsolute.txt

     文件        847  2009-12-14 09:41  PThreadDemo3\PThreadDemo3\obj\Debug\PThreadDemo2.csproj.GenerateResource.Cache

     文件        665  2009-12-14 11:47  PThreadDemo3\PThreadDemo3\obj\Debug\PThreadDemo3.csproj.FileListAbsolute.txt

     文件        847  2009-12-14 09:54  PThreadDemo3\PThreadDemo3\obj\Debug\PThreadDemo3.csproj.GenerateResource.Cache

     文件        472  2009-12-14 09:11  PThreadDemo3\PThreadDemo3\Program.cs

     文件       1354  2009-12-14 09:11  PThreadDemo3\PThreadDemo3\Properties\AssemblyInfo.cs

     文件       2872  2009-12-14 09:11  PThreadDemo3\PThreadDemo3\Properties\Resources.Designer.cs

     文件       5612  2009-12-14 09:11  PThreadDemo3\PThreadDemo3\Properties\Resources.resx

     文件       1096  2009-12-14 09:11  PThreadDemo3\PThreadDemo3\Properties\Settings.Designer.cs

     文件        249  2009-12-14 09:11  PThreadDemo3\PThreadDemo3\Properties\Settings.settings

     文件       3354  2009-12-14 09:11  PThreadDemo3\PThreadDemo3\PThreadDemo3.csproj

     文件        926  2009-12-14 09:45  PThreadDemo3\PThreadDemo3.sln

    ..A..H.     14336  2009-12-14 11:47  PThreadDemo3\PThreadDemo3.suo

     文件       9216  2009-12-14 11:47  PThreadDemo4\PThreadDemo4\bin\Debug\PTheadDemo.exe

     文件      26112  2009-12-14 11:47  PThreadDemo4\PThreadDemo4\bin\Debug\PTheadDemo.pdb

     文件      14328  2009-12-14 16:20  PThreadDemo4\PThreadDemo4\bin\Debug\PTheadDemo.vshost.exe

     文件        490  2007-07-21 01:33  PThreadDemo4\PThreadDemo4\bin\Debug\PTheadDemo.vshost.exe.manifest

............此处省略265个文件信息

评论

共有 条评论