asp.net中带窗口服务的多线程

asp.net中带窗口服务的多线程,asp.net,multithreading,Asp.net,Multithreading,我可以在多个线程中使用相同的进程吗 共有5类: 1类-发送100000封邮件 2类-发送10000封邮件 3类-200000邮件发送 4类-发送1000封邮件 5类-发送300000封邮件 使用两个线程的 为每个类别发送邮件的线程时间:[线程1]为类别1花费了40分钟;[Thread 2]花了10分钟完成第2类 [Category 3]应由线程2选取,然后随机选取其他类别。我正在backgorund进程中使用带有窗口服务的Asp.net NewsLatterThrea

我可以在多个线程中使用相同的进程吗

共有5类:

  • 1类-发送100000封邮件
  • 2类-发送10000封邮件
  • 3类-200000邮件发送
  • 4类-发送1000封邮件
  • 5类-发送300000封邮件
使用两个线程的

为每个类别发送邮件的线程时间:[线程1]为类别1花费了40分钟;[Thread 2]花了10分钟完成第2类 [Category 3]应由线程2选取,然后随机选取其他类别。我正在backgorund进程中使用带有窗口服务的Asp.net

            NewsLatterThread1 = new Thread(new ThreadStart(SendNewsLatterStatus));
            NewsLatterThread1.Name = "NewsLatter1";

            NewsLatterThread2 = new Thread(new ThreadStart(SendNewsLatterStatus));
            NewsLatterThread2.Name = "NewsLatter2";

            NewsLatterThread1.Start();
            NewsLatterThread2.Start();

            NewsLatterThread1.Join();
            NewsLatterThread2.Join();

            NewsLatterThread1.Abort();
            NewsLatterThread2.Abort();
这是获取邮件详细信息的方法:
SendNewsLatterStatus
所以[Category 3]继续执行线程2,然后随机抽取 线程中的类别。。 在asp.net中,在后台进程中使用窗口服务

            NewsLatterThread1 = new Thread(new ThreadStart(SendNewsLatterStatus));
            NewsLatterThread1.Name = "NewsLatter1";

            NewsLatterThread2 = new Thread(new ThreadStart(SendNewsLatterStatus));
            NewsLatterThread2.Name = "NewsLatter2";

            NewsLatterThread1.Start();
            NewsLatterThread2.Start();

            NewsLatterThread1.Join();
            NewsLatterThread2.Join();

            NewsLatterThread1.Abort();
            NewsLatterThread2.Abort();

它不能正常工作。错误是什么?你需要首先明确你的线程概念

读这个 这肯定会澄清问题,也会理清你的疑问