Files
Reims-Go/internal/host/scheduling.go
T
NwflowerandClaude Opus 5.5 4cf1e8ea37 feat(host): open Windows processor scheduling as administrator
The host page's optimizations list gains a "Windows processor scheduling"
row: it shows whether Windows favours programs or background services
(Win32PrioritySeparation, read without elevation) and a button that opens
System Properties' Performance Options through one UAC prompt, so the
choice saves without a second one. Declining the prompt is not an error.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-29 00:31:18 -07:00

21 lines
731 B
Go

package host
// Windows "Processor scheduling" (System Properties > Advanced > Performance >
// Advanced): Programs gives the foreground window's process longer CPU
// quanta, Background services gives every process the same fixed quanta.
const (
SchedulingPrograms = "programs"
SchedulingBackground = "background"
)
// SchedulingFromPrioritySeparation reads the setting from the registry's
// Win32PrioritySeparation value: its low two bits are the foreground quantum
// boost, which Programs sets (0x26 from that dialog, 0x2 on a fresh install)
// and Background services clears (0x18).
func SchedulingFromPrioritySeparation(v uint32) string {
if v&0x3 != 0 {
return SchedulingPrograms
}
return SchedulingBackground
}