feat(gameserver): single-threaded world simulation, no lock (#54) #56
No reviewers
Labels
No labels
alpha:wave-0
alpha:wave-1
alpha:wave-2
alpha:wave-3
area:assets
area:combat
area:ecology
area:infra
area:render
area:scripting
area:ui
area:world
enhancement
epic
migration
post-alpha
roadmap
tech-debt
type:bug
type:chore
type:design
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
marco/IsoMmo!56
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/simulation-executor"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Single-threaded world simulation (ModernUO-style) — closes the command-queue study (#54).
What changed
Worldis now touched by exactly one thread — theSimulation's — and holds no lock.Simulationexecutor: an unboundedChannel<Func<Task>>drained by one thread;InvokeAsync<T>marshals work from any thread and returns its result; aPeriodicTimerposts the tick onto the same queue (serialized with all other work).WorldTick(the full AoI reconcile) +SimulationHost(BackgroundService running the executor).GameLoopServicedeleted.Worldaccess routed throughSimulation.InvokeAsync:GameSessionHandler(connect/disconnect/move/say/pickup/drop/equip/unequip/attack/GM/target),WorldPersistersnapshot. Cross-domain reads a caller needs together collapse into oneInvokeAsync.World._gateremoved: every method is a pure delegate, atomicity comes from single-threaded execution.InterestManagerkeeps its own lock — itsEnter/Leaverun on connection threads, so it is deliberately outside the sim.Verification
just lint— build succeeded, 0 warnings.just test— full suite green (GameServer 115, Shared 51, Client.Core 46, Auth 12, Assets 4, AssetExtractor 7).Definition of Done
Worldhas no lock; all callers reach it viaSimulation.InvokeAsync(or are the tick / single-threaded startup).InvokeAsync.GameLoopServicegone;SimulationHost+WorldTickreplace it.feat(gameserver): single-threaded Simulation executor (command-queue Phase 1, #54)to feat(gameserver): single-threaded world simulation, no lock (#54)