diff --git a/SabreTools.Helper/Data/Build.cs b/SabreTools.Helper/Data/Build.cs
index fb552cd7..95260ac0 100644
--- a/SabreTools.Helper/Data/Build.cs
+++ b/SabreTools.Helper/Data/Build.cs
@@ -192,6 +192,7 @@ namespace SabreTools.Helper
helptext.Add(" -rar={2} Set scanning level for RAR archives");
helptext.Add(" -zip={0} Set scanning level for ZIP archives");
helptext.Add(" -ud, --update-dat Output updated DAT");
+ helptext.Add(" -mt={4} Amount of threads to use (-1 unlimted)");
// Stats
helptext.Add(" -st, --stats Get statistics on all input DATs");
@@ -305,6 +306,7 @@ namespace SabreTools.Helper
helptext.Add(" Supported values are:");
helptext.Add(" None, Good, BadDump, Nodump, Verified, NotNodump");
helptext.Add(" -out= Output directory (overridden by --inplace)");
+ helptext.Add(" -mt={4} Amount of threads to use (-1 unlimted)");
// Verify
helptext.Add(" -ve, --verify Verify a folder against DATs");
@@ -329,7 +331,7 @@ namespace SabreTools.Helper
helptext.Add("Filter parameters for size can use postfixes for inputs:");
helptext.Add(" e.g. 8kb => 8000 or 8kib => 8192");
break;
- case "SimpleSortApp":
+ case "SimpleSort":
helptext.Add(Resources.Resources.SimpleSort_Name + " - " + Resources.Resources.SimpleSort_Desc);
helptext.Add(barrier);
helptext.Add(Resources.Resources.Usage + ": " + Resources.Resources.SimpleSort_Name + " [options] [filename|dirname] ...");
diff --git a/SabreTools.Helper/README.1ST b/SabreTools.Helper/README.1ST
index 5f3c9662..c6379789 100644
--- a/SabreTools.Helper/README.1ST
+++ b/SabreTools.Helper/README.1ST
@@ -458,6 +458,12 @@ Options:
0 Hash both archive and its contents
1 Only hash contents of the archive
2 Only hash archive itself (treat like a regular file)
+
+ -mt={4} Amount of threads to use
+ Optionally, set the number of threads to use for the multithreaded operations.
+ The default is 4 threads; -1 means unlimited threads created. If the user specifies
+ that only 1 thread is to be used, it defaults to the original, serial implementation
+ of the DFD code.
-ud, --update-dat Output updated DAT (rebuild only)
Once the files that were able to rebuilt are taken care of, a DAT of the files
@@ -793,6 +799,12 @@ Options:
This sets an output folder to be used when the files are created. If a path
is not defined, the application directory is used instead.
+ -mt={4} Amount of threads to use
+ Optionally, set the number of threads to use for the multithreaded operations.
+ The default is 4 threads; -1 means unlimited threads created. If the user specifies
+ that only 1 thread is to be used, it defaults to the original, serial implementation
+ of the DFD code.
+
-ve, --verify Verify a folder against an input DAT
When used, this will use an input DAT or set of DATs to blindly check against an input
folder. The base of the folder is considered the base for the combined DATs and games are
diff --git a/SabreTools/Partials/SabreTools_Inits.cs b/SabreTools/Partials/SabreTools_Inits.cs
index d4fa217b..7d2b9d88 100644
--- a/SabreTools/Partials/SabreTools_Inits.cs
+++ b/SabreTools/Partials/SabreTools_Inits.cs
@@ -306,8 +306,10 @@ namespace SabreTools
/// Integer representing the archive handling level for Zip
/// True if the updated DAT should be output, false otherwise
/// Populated string representing the name of the skipper to use, a blank string to use the first available checker, null otherwise
+ /// Integer representing the maximum amount of parallelization to be used
private static void InitSort(List datfiles, List inputs, string outDir, string tempDir, bool quickScan, bool date,
- bool toFolder, bool delete, bool tgz, bool romba, int sevenzip, int gz, int rar, int zip, bool updateDat, string headerToCheckAgainst)
+ bool toFolder, bool delete, bool tgz, bool romba, int sevenzip, int gz, int rar, int zip, bool updateDat, string headerToCheckAgainst,
+ int maxDegreeOfParallelism)
{
// Get the archive scanning level
ArchiveScanLevel asl = ArchiveTools.GetArchiveScanLevelFromNumbers(sevenzip, gz, rar, zip);
@@ -323,7 +325,8 @@ namespace SabreTools
}
_logger.User("Populating complete in " + DateTime.Now.Subtract(start).ToString(@"hh\:mm\:ss\.fffff"));
- FileTools.RebuildToOutput(datdata, inputs, outDir, tempDir, quickScan, date, toFolder, delete, tgz, romba, asl, updateDat, headerToCheckAgainst, 4, _logger);
+ FileTools.RebuildToOutput(datdata, inputs, outDir, tempDir, quickScan, date, toFolder, delete, tgz, romba, asl,
+ updateDat, headerToCheckAgainst, maxDegreeOfParallelism, _logger);
}
///
diff --git a/SabreTools/SabreTools.cs b/SabreTools/SabreTools.cs
index 115cb124..c5ada7d4 100644
--- a/SabreTools/SabreTools.cs
+++ b/SabreTools/SabreTools.cs
@@ -981,7 +981,7 @@ namespace SabreTools
else if (sort)
{
InitSort(datfiles, inputs, outDir, tempDir, quickScan, addFileDates, toFolder,
- delete, tgz, romba, sevenzip, gz, rar, zip, updateDat, header);
+ delete, tgz, romba, sevenzip, gz, rar, zip, updateDat, header, maxParallelism);
}
// Split a DAT by extension
diff --git a/SimpleSort/SimpleSortApp.cs b/SimpleSort/SimpleSort.cs
similarity index 99%
rename from SimpleSort/SimpleSortApp.cs
rename to SimpleSort/SimpleSort.cs
index 27118606..404ddfd8 100644
--- a/SimpleSort/SimpleSortApp.cs
+++ b/SimpleSort/SimpleSort.cs
@@ -5,7 +5,7 @@ using System.IO;
namespace SabreTools
{
- public class SimpleSortApp
+ public class SimpleSort
{
///
/// Main entry point for the program
diff --git a/SimpleSort/SimpleSort.csproj b/SimpleSort/SimpleSort.csproj
index f1a960ab..ba55fdda 100644
--- a/SimpleSort/SimpleSort.csproj
+++ b/SimpleSort/SimpleSort.csproj
@@ -67,7 +67,7 @@
-
+