Move the simulation thread pool from the model to the driver#382
Merged
mattdailis merged 4 commits intodevelopfrom Nov 11, 2022
Merged
Move the simulation thread pool from the model to the driver#382mattdailis merged 4 commits intodevelopfrom
mattdailis merged 4 commits intodevelopfrom
Conversation
bb51346 to
a0d1bab
Compare
mattdailis
approved these changes
Nov 4, 2022
a0d1bab to
2abfa74
Compare
Twisol
commented
Nov 8, 2022
00caf77 to
29e7081
Compare
29e7081 to
858e565
Compare
858e565 to
cc67f20
Compare
cc67f20 to
51da7ea
Compare
camargo
approved these changes
Nov 11, 2022
51da7ea to
495c98d
Compare
pcrosemurgy
approved these changes
Nov 11, 2022
camargo
added a commit
to NASA-AMMOS/plandev-ui
that referenced
this pull request
Nov 15, 2022
JosephVolosin
pushed a commit
to NASA-AMMOS/plandev-ui
that referenced
this pull request
Aug 20, 2024
JosephVolosin
pushed a commit
to NASA-AMMOS/plandev-ui
that referenced
this pull request
Oct 21, 2024
dandelany
pushed a commit
to NASA-AMMOS/plandev-ui
that referenced
this pull request
Aug 14, 2025
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.
Description
This PR moves the
ExecutionServicefor thread pooling from the model into the driver -- specifically, theSimulationEngine. Anything in the model that spawns a task now passes aTaskFactoryback to the driver, rather than constructing aTasklocally. This avoids a great deal of the work previously necessary to make theExecutionServiceavailable wherever it was needed in the model, and generally streamlines interactions between the two sides.As a result of these changes:
RootModelis no longer necessary (as it simply bundle theExecutionServicealongside the mission's own model).MerlinExtensionno longer needs a model provided to it in test cases, soMerlinTextContextis no longer necessary. Also, the type parameters onMerlinExtensionhave gone away, meaning we can always use@ExtendWith(MerlinExtension.class)rather than the awkward field-based@RegisterExtension. Hurray!--enable-previewpresent, but now it should be easier than ever to trial simulation on Loom.)Verification
Build succeeds. I haven't actually tried enabling Loom on this PR because it's kind of a pain to configure Gradle, but if Loom isn't available it will fall back to the existing thread pool anyway. (I did actually try Loom just before JDK 19 was released, and it worked without hiccups. Anyway, if you run with
--enable-preview, you're explicitly opting in to potential instability, so...)Documentation
Probably some of the testing documentation needs to change. I also updated a code snippet for
ActivityMapperthat referencedRootModelwhen I was removing it.Future work
Registrar.allocatecells during simulation instead of only at construction time. This would avoid the need for a test constructor entirely. Entirely! (But also, it opens up some interesting patterns for shared local simulation state between tasks that there isn't much reason to forbid.)