mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
29 lines
706 B
C#
29 lines
706 B
C#
using System;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace SabreTools.Core
|
|
{
|
|
/// <summary>
|
|
/// Globally-accessible objects for the library
|
|
/// </summary>
|
|
public class Globals
|
|
{
|
|
#region Public accessors
|
|
|
|
/// <summary>
|
|
/// Maximum threads to use during parallel operations
|
|
/// </summary>
|
|
public static int MaxThreads { get; set; } = Environment.ProcessorCount;
|
|
|
|
/// <summary>
|
|
/// ParallelOptions object for use in parallel operations
|
|
/// </summary>
|
|
public static ParallelOptions ParallelOptions => new ParallelOptions()
|
|
{
|
|
MaxDegreeOfParallelism = MaxThreads
|
|
};
|
|
|
|
#endregion
|
|
}
|
|
}
|