Skip to content

Commit

Permalink
dll: FspFileSystemStartDispatcher
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
billziss-gh committed Jun 11, 2019
1 parent 8ad77fe commit 3902874
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/dll/fs.c
Expand Up @@ -24,6 +24,8 @@
enum
{
FspFileSystemDispatcherThreadCountMin = 2,
FspFileSystemDispatcherDefaultThreadCountMin = 4,
FspFileSystemDispatcherDefaultThreadCountMax = 16,
};

static FSP_FILE_SYSTEM_INTERFACE FspFileSystemNullInterface;
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 3902874

Please sign in to comment.