Index: Slim/Utils/OS/Win32.pm =================================================================== --- Slim/Utils/OS/Win32.pm (revision 30499) +++ Slim/Utils/OS/Win32.pm (working copy) @@ -621,6 +621,27 @@ if ($@) { Slim::Utils::Log->logError("Couldn't set priority to $priorityClassName ($^E) [$@]"); } + + # On Windows Vista and above, use VERY LOW I/O priority when CPU priority is LOW and NORMAL I/O priority for all other CPU priorities. + # Windows Task Scheduler uses LOW I/O priority with BELOW NORMAL CPU priority for tasks. Therefore, using VERY LOW I/O priority with to LOW CPU priority is reasonable. + # Setting I/O priority to LOW isn't possible using the published API, otherwise we could do this for when CPU priority is BELOW_NORMAL. + if ($class->{osDetails}->{'isWin6+'}) { + if ($priorityClassName eq 'BELOW_NORMAL' || 'NORMAL' || 'ABOVE_NORMAL' || 'HIGH') { + # Use hardcoded value since Win32::Process doesn't provide PROCESS_MODE_BACKGROUND_END + eval { $setPriorityClass->Call($processHandle, 0x00200000) }; + if ($@) { + Slim::Utils::Log->logError("Couldn't set I/O priority to NORMAL ($^E) [$@]"); + } + } + if ($priorityClassName eq 'LOW') { + # Use hardcoded value since Win32::Process doesn't provide PROCESS_MODE_BACKGROUND_BEGIN + eval { $setPriorityClass->Call($processHandle, 0x00100000) }; + if ($@) { + Slim::Utils::Log->logError("Couldn't set I/O priority to VERY LOW ($^E) [$@]"); + } + } + } + } }