Changeset - c9ad5ae6640a
[Not reviewed]
default
0 2 0
Jason Maltzen (jmaltzen) - 9 years ago 2016-01-15 17:25:49
jason.maltzen@unsanctioned.net
Add a thread count for paint recipe generation to settings
2 files changed with 9 insertions and 1 deletions:
0 comments (0 inline, 0 general)
RecipeGenerator.cs
Show inline comments
...
 
@@ -72,2 +72,4 @@ namespace DesertPaintLab
 

	
 
        public uint MaxThreads { get; set; }
 

	
 
        ReactionSet reactions;
...
 
@@ -272,3 +274,3 @@ namespace DesertPaintLab
 

	
 
            int threadCount = Math.Min(costSortedReagents.Count, searchQueue.Count);
 
            int threadCount = Math.Min(Math.Min(costSortedReagents.Count, searchQueue.Count), (int)MaxThreads);
 
            if (threadCount == 0)
...
 
@@ -281,2 +283,3 @@ namespace DesertPaintLab
 
            generatorThreads.Clear();
 
            System.Console.WriteLine("Starting {0} generator threads.", threadCount);
 
            for (int i = 0; i < threadCount; ++i)
...
 
@@ -284,2 +287,3 @@ namespace DesertPaintLab
 
                Thread thr = new Thread(new ThreadStart(this.Generate));
 
                thr.Priority = ThreadPriority.BelowNormal;
 
                generatorThreads.Add(thr);
RecipeGeneratorWindow.cs
Show inline comments
...
 
@@ -118,2 +118,6 @@ namespace DesertPaintLab
 
            generator = new RecipeGenerator(profile.Reactions);
 
            int threads;
 
            DesertPaintLab.Settings.Get("GeneratorThreads", out threads);
 
            if (threads <= 0) { threads = 15; }
 
            generator.MaxThreads = (uint)threads;
 
            generator.InitRecipes(profile.Recipes);
0 comments (0 inline, 0 general)