Implement max thread count setting using semaphores

This commit is contained in:
Asriel Camora
2023-10-02 23:02:11 -07:00
parent 42a1bc1117
commit 6bfff06ac4
5 changed files with 62 additions and 20 deletions
+16
View File
@@ -240,6 +240,22 @@ public class Settings : Window
ref isDirty
);
ImGui.BeginDisabled(config.Algorithm is not (SolverAlgorithm.OneshotForked or SolverAlgorithm.StepwiseForked or SolverAlgorithm.StepwiseFurcated));
DrawOption(
"Max Core Count",
"The number of cores to use when solving. You should use as many\n" +
"as you can. If it's too high, it will have an effect on your gameplay\n" +
$"experience. A good estimate would be 1 or 2 cores less than your\n" +
$"system (FYI, you have {Environment.ProcessorCount} cores,) but\n" +
$"make sure to accomodate for any other tasks you have in the\n" +
$"background, if you have any.\n" +
"(Only used in the Forked and Furcated algorithms)",
config.MaxThreadCount,
v => config = config with { MaxThreadCount = v },
ref isDirty
);
ImGui.EndDisabled();
ImGui.BeginDisabled(config.Algorithm is not (SolverAlgorithm.OneshotForked or SolverAlgorithm.StepwiseForked or SolverAlgorithm.StepwiseFurcated));
DrawOption(
"Fork Count",