ft: parallel entity processing optimizations and stability fixes#14
Open
Xytronix wants to merge 1 commit intoIroriPowered:masterfrom
Open
ft: parallel entity processing optimizations and stability fixes#14Xytronix wants to merge 1 commit intoIroriPowered:masterfrom
Xytronix wants to merge 1 commit intoIroriPowered:masterfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds parallel entity processing optimizations and stability fixes for high-entity-count servers.
Type of change
Implementation details
isInThread()relaxation): OverridesisInThread()to returntrueforForkJoinWorkerThreads belonging toForkJoinPool.commonPool(). Without this, parallel entity ticking deadlocks: the world thread blocks waiting for pool tasks, while pool tasks try to bounce World method calls (chunk lookups, player queries) back to the blocked world thread viasupplyAsync(..., this).join().forEachChunkposition collection inSpatialSystem.tick()with parallel per-chunk collection into thread-local buffers, followed by sequential merge intoSpatialData. It falls back to sequential for ≤2 chunks.ForkJoinPool.commonPool(), collects(position, ref)pairs into local lists, then merges intoSpatialDatasequentially.isParallel()forSteeringSystem. It is gated behind a threshold (default 64) and is safe production, but can cause a crash if debugging enabled (non-atomic save).queueUpdate/queueRemovecalls for entities not in the visibility set, instead of throwingIllegalArgumentException(which disconnects the player).Universe.get().getDefaultWorld()from constructor if universe is not ready, adds null guards onwatchdogThread.interrupt()inunregisterService(),lastDefaultWorld.getName()instart()and fixes integer division for timeout logging.Checklist
spotlessApplywhen necessary)