cpupin_other.go 610 B

123456789101112131415161718
  1. //go:build !linux || android || e2e_testing
  2. package util
  3. // PinThreadToCPU is a no-op outside Linux: only Linux exposes a stable
  4. // per-thread CPU affinity API and only Linux has XPS-driven TX ring
  5. // selection in the first place. On every other platform there's nothing
  6. // to fix here.
  7. func PinThreadToCPU(_ int) error {
  8. return nil
  9. }
  10. // AllowedCPUs has no meaningful answer off Linux (no sched_getaffinity), so it
  11. // reports "unknown" by returning a nil slice and nil error. Callers treat an
  12. // empty result as "fall back to the default CPU choice".
  13. func AllowedCPUs() ([]int, error) {
  14. return nil, nil
  15. }