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.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor Node Processing to allow Scene Multithreading #75901
Refactor Node Processing to allow Scene Multithreading #75901
Changes from all commits
98c655e
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be an (advanced) editor setting so node threading for the editor can be toggled on/off.
Given the editor uses a wide surface of the engine apis, this would help with identifying bugs and issues with the node threading implementation. As an example, the Android port of the editor has already allowed us to identify bugs and issues with the engine on Android platforms.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep in mind that the way threading works at scene level means that it has to be manually used and configured by the developer to better fit the games, and most of the editor is pretty much just GUI (which will not support threading), so ultimately it does not make much sense to make the editor support this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean by GUI will not support threading?
From the proposal and the screenshot above, it looks like threading can be configured within a scene granularly at the node level.
So just based off the screenshot, it would seem possible to configure different sections/nodes within the
EditorNode
to run on different threads. I agree there may not be a reason to do so, but nonetheless the capability is there.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GUI will not support threading, because it does a lot of interactions at the tree level across nodes that can easily exit your thread workgroups and go somewhere else (like container resizing). The engine can catch this fine and throw an error, but ultimately if you have a large connected GUI you can't easily split it up in threads. It can be implemented at some point, but it would be a lot of work for very little benefit. Add to this that the GUI does very little amount of work in the process callbacks (which is what gets parallelized) so even if it could be parallelized the benefit would be very minimum.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, that makes sense at the moment.
Although it's worth pointing out that the use of Godot as a UI framework to develop applications is likely to increase over time, and most current UI frameworks also have the concept of splitting work across multiple threads, so that may be something worth considering in the future.
At the moment, yes that is not much of a concern.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If GUI elements are isolated into separate viewports, could each viewport be in its own thread?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lyuma From what I understand, Control nodes will be have their "thread group" stuck to
main_thread
and "group order" to0
. So their parent settings will not influence their process.