dll: FspFileSystemStartDispatcher

Change default number of threads when ThreadCount==0 is passed.
New min DEFAULT number of threads is 4 and new max DEFAULT number of threads is 16.
The absolute minimum number of threads that any file system dispatcher has remains 2.
This commit is contained in:
Bill Zissimopoulos 2019-06-11 11:51:20 -07:00
parent 8ad77fe62f
commit 3902874ac9

View File

@ -24,6 +24,8 @@
enum
{
FspFileSystemDispatcherThreadCountMin = 2,
FspFileSystemDispatcherDefaultThreadCountMin = 4,
FspFileSystemDispatcherDefaultThreadCountMax = 16,
};
static FSP_FILE_SYSTEM_INTERFACE FspFileSystemNullInterface;
@ -636,6 +638,11 @@ FSP_API NTSTATUS FspFileSystemStartDispatcher(FSP_FILE_SYSTEM *FileSystem, ULONG
for (ThreadCount = 0; 0 != ProcessMask; ProcessMask >>= 1)
ThreadCount += ProcessMask & 1;
if (ThreadCount < FspFileSystemDispatcherDefaultThreadCountMin)
ThreadCount = FspFileSystemDispatcherDefaultThreadCountMin;
else if (ThreadCount > FspFileSystemDispatcherDefaultThreadCountMax)
ThreadCount = FspFileSystemDispatcherDefaultThreadCountMax;
}
if (ThreadCount < FspFileSystemDispatcherThreadCountMin)