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.
This pull request (PR) aims to address issue #4590.
It updates the test runner and test module to allow the runner to spawn new threads during execution, while respecting the total number of threads Mill can utilize (as defined by the --jobs flag).
To prevent the test runner from overwhelming the system with threads, the parent test module must grant permissions to its child runners. A child runner can only spawn a new thread with this permission, and it will "return" the thread to the parent module upon completion or process termination. Inter-process communication is currently implemented using a memory-mapped file for simplicity and performance.
Note that this PR does not yet implement a work-stealing thread pool. The primary goal is to verify the feasibility of this approach and identify any necessary adjustments. If this direction proves suitable, I'll follow up with the work-stealing thread pool implementation, which should be straightforward given the existing foundation.