Migrate Process tab manual affinity apply to CpuSelection (#16)
Migrate Process tab manual affinity apply to CpuSelection Route manual Process tab affinity operations through a topology-aware coordinator so CpuSelection and CPU Sets are preferred over legacy long masks. - Add ProcessAffinityApplyCoordinator for manual Process tab affinity apply - Prefer CoreMask.CpuSelection when available - Migrate legacy BoolMask selections to CpuSelection when topology is available - Block unsafe legacy fallback for selections above CPU64 - Keep legacy long mask fallback only for safe single-group <=64 selections - Wire SetAffinity, ApplyCoreMaskToProcessAsync and QuickApplyAffinityAndPowerPlan through the coordinator - Document CoreMask.ToProcessorAffinity as legacy-only - Ensure ProcessViewModel fallback coordinator receives topology provider - Add regression tests for CPU64, multi-group, safe legacy fallback, migration and protected-process messages No UI redesign, preset generator, memory priority, persistent rules engine, migration logic, version or tag changes.
This commit is contained in:
@@ -45,6 +45,7 @@ namespace ThreadPilot.ViewModels
|
||||
private readonly IProcessPowerPlanAssociationService associationService;
|
||||
private readonly IGameModeService gameModeService;
|
||||
private readonly IAffinityApplyService affinityApplyService;
|
||||
private readonly IProcessAffinityApplyCoordinator processAffinityApplyCoordinator;
|
||||
private System.Timers.Timer? refreshTimer;
|
||||
private bool isUiRefreshPaused;
|
||||
private bool isProcessViewActive = true;
|
||||
@@ -177,6 +178,8 @@ namespace ThreadPilot.ViewModels
|
||||
IProcessPowerPlanAssociationService associationService,
|
||||
IGameModeService gameModeService,
|
||||
IAffinityApplyService? affinityApplyService = null,
|
||||
IProcessAffinityApplyCoordinator? processAffinityApplyCoordinator = null,
|
||||
ICpuTopologyProvider? cpuTopologyProvider = null,
|
||||
IEnhancedLoggingService? enhancedLoggingService = null)
|
||||
: base(logger, enhancedLoggingService)
|
||||
{
|
||||
@@ -194,6 +197,11 @@ namespace ThreadPilot.ViewModels
|
||||
this.processService,
|
||||
this.cpuTopologyService,
|
||||
NullLogger<AffinityApplyService>.Instance);
|
||||
this.processAffinityApplyCoordinator = processAffinityApplyCoordinator ?? new ProcessAffinityApplyCoordinator(
|
||||
this.affinityApplyService,
|
||||
cpuTopologyProvider,
|
||||
new CpuSelectionMigrationService(),
|
||||
NullLogger<ProcessAffinityApplyCoordinator>.Instance);
|
||||
|
||||
// Subscribe to topology detection events
|
||||
this.cpuTopologyService.TopologyDetected += this.OnTopologyDetected;
|
||||
@@ -217,4 +225,3 @@ namespace ThreadPilot.ViewModels
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user