Class DispatcherLowPriority
Built for long-running background jobs, won't monopolize the CPU away from this process or the rest of the user's OS while performing tasks
public static class DispatcherLowPriority
- Inheritance
-
objectDispatcherLowPriority
Remarks
The claim made above cannot be guaranteed for OS outside of Windows, it will spread out the work further to avoid blocking but dense workload may still block. PR to improve support for those platforms are welcome.
Properties
MaxDegreeOfParallelism
Set the amount of threads in the pool
public static int MaxDegreeOfParallelism { get; set; }
Property Value
Exceptions
- ArgumentOutOfRangeException
Value is less than or equal to zero
Methods
ForBatchedAsync(int, ProcessItemRange)
Built for long-running background jobs, won't monopolize the CPU away from this process or the rest of the user's OS while performing tasks
public static Task ForBatchedAsync(int items, DispatcherLowPriority.ProcessItemRange processItemsRange)
Parameters
itemsintThe amount of items to process
processItemsRangeDispatcherLowPriority.ProcessItemRangeThe method running in parallel
Returns
- Task
A task to await for completion
Remarks
The claim made above cannot be guaranteed for OS outside of Windows, it will spread out the work further to avoid blocking but dense workload may still block. PR to improve support for those platforms are welcome.