Create a single place for all chunky thread/executors to be registered - #1895
Open
NotStirred wants to merge 13 commits into
Open
Create a single place for all chunky thread/executors to be registered#1895NotStirred wants to merge 13 commits into
NotStirred wants to merge 13 commits into
Conversation
leMaik
reviewed
Jul 13, 2026
NotStirred
commented
Jul 24, 2026
| if (waitTime > 0) { | ||
| thread.join(waitTime); // joining with 0 is infinite wait time, very intuitive. | ||
| } | ||
| // Thread.isAlive() establishes a happens-before with the thread. As such the following are non-issues: |
Member
Author
There was a problem hiding this comment.
This is stated in JLS17 at: 17.4.4:
The final action in a thread T1 synchronizes-with any action in another thread T2 that detects that T1 has terminated.
Closes chunky-dev#1893 - Allows chunky to close them on shutdown without a System.exit() - Additionally provides an api to wait on all chunky threads to be joined.
And hopefully be more readable
NotStirred
force-pushed
the
fix/non_daemon_threads
branch
from
July 26, 2026 20:25
652e737 to
e69129b
Compare
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.
I'm not tied to any of the specifics here, but having a mechanism to wait on chunky to join its threads is very important with Bedrock.
Essentially leveldb is thread safe on reads, so I don't want to lock. If region parsers/chunk loading are active when the DB is closed it races and results in almost always a
segfault/pthread lockerror. TheChunkyThread#joinAll()lets the shutdown hook wait for everything before closing the db.Closes #1893