相关疑难解决方法(0)

有没有办法增加c#中的堆栈大小?

几年后我没有做任何事情,我回到编程,并创建了一个数独游戏让我的脚再次湿润.我已经编写了一个递归函数来强制执行一个解决方案,它将针对简单的电路板状态执行此操作,但是对于更复杂的电路板状态,大多数情况下都会进入堆栈溢出.我知道这可以避免使用循环或更有效的算法,但由于这是为了学习我想知道如何为堆栈分配更多内存(承认这不是问题的最佳解决方案).

答案如下:如何更改.NET程序的堆栈大小?建议使用分配更多内存的线程不起作用,因为我可以阅读.NET 4.0将不会让你增加超出默认值的线程的最大分配内存.

另一个解决方案建议使用EDITBIN.EXE,但我是Visual Studio的新手,并没有找到我理解如何这样做的解释.

同样,我发现你可以使用.def文件来指示更大的默认堆栈大小,但是没有找到我理解如何创建/实现一个的解释.

任何人都可以提供EDITBIN.EXE或.def文件实现的新手级解释,或提供另一种方法来增加堆栈大小?

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

namespace Sudoku
{
    //object keeps track of the value of all numbers currently on the board using an array

    class BoardState
    {
        int testcount = 1;
        //3d array of ints representing all values on the board, represted as region, column, row
        int[,,] boardVals;

        //3d array of bools representing if a number is immutable (true cannot be changed, false can …
Run Code Online (Sandbox Code Playgroud)

c# stack-overflow recursion multithreading

4
推荐指数
1
解决办法
167
查看次数

标签 统计

c# ×1

multithreading ×1

recursion ×1

stack-overflow ×1