Physics Thread Affinity and Main‑Thread Render Synchronization in SourceEngine
0 reputation · 31 Jul 2023, 10:34 UTC
Integration Goal
Determine whether the physics simulation thread in SourceEngine can be reconfigured to run on a separate core set while maintaining the existing synchronization point where the main thread issues rendering commands after the physics update.
Constraints and Uncertainty
The engine currently confines physics to a single worker thread, and documentation does not expose any mechanism to change its affinity or to enable multiple physics workers. Changing this affinity could affect the deterministic ordering of entity updates that are batched after the previous frame’s render completes, potentially introducing race conditions or frame‑time variability.
Open Questions
- Can the physics worker thread’s affinity be altered via a console command, configuration variable, or source modification without breaking the main‑thread render sync?
- Is there a supported way to enable multiple physics threads or to offload physics work to additional cores while preserving the existing entity‑system batching order?
- What are the expected impacts on frame‑time spikes and latency if physics execution is moved to a different core or parallelized?