相关疑难解决方法(0)

简单的素数程序 - 线程C#的奇怪问题

这是我的代码:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;

namespace FirePrime
{
    class Program
    {
        static bool[] ThreadsFinished;
        static bool[] nums;

        static bool AllThreadsFinished()
        {
            bool allThreadsFinished = false;
            foreach (var threadFinished in ThreadsFinished)
            {
                allThreadsFinished &= threadFinished;
            }
            return allThreadsFinished;
        }

        static bool isPrime(int n)
        {
            if (n < 2) { return false; }
            if (n == 2) { return true; }
            if (n % 2 == 0) { return false; }
            int d = 3;
            while …
Run Code Online (Sandbox Code Playgroud)

c# algorithm multithreading

2
推荐指数
1
解决办法
2048
查看次数

标签 统计

algorithm ×1

c# ×1

multithreading ×1