Skip to content
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

Include a warning about a multi-threaded pitfall #5227

Closed
gokiburikin opened this issue Sep 6, 2021 · 0 comments · Fixed by #5311
Closed

Include a warning about a multi-threaded pitfall #5227

gokiburikin opened this issue Sep 6, 2021 · 0 comments · Fixed by #5311

Comments

@gokiburikin
Copy link

Describe the project you are working on

A calculation heavy 2D tower defense utilizing multiple threads for performance.

Describe the problem or limitation you are having in your project

Ran into a crash I couldn't understand, singled it out to instancing a specific PackedScene in a thread. Was about to submit a minimal reproducible project when on my last search for an answer I found the culprit: godotengine/godot#20964 (comment)

Switching to Multi-Threaded in project settings fixes the issue, but this is not mentioned in the documentation as a potential pain point and it (probably?) can't be supplied as a warning or error since it's in a thread. To add extra confusion, this only seems to happen if the PackedScene contains a Node that needs to be rendered (Sprite, Control, etc.)

Describe the feature / enhancement and how it helps to overcome the problem or limitation

Adding a notice to the threading page found here: https://docs.godotengine.org/en/stable/tutorials/threads/using_multiple_threads.html

It would have saved me an hour or two and may save others time as well.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

image

This particular text is not specific to PackedScenes that include renderable Nodes, so it could probably be improved.

If this enhancement will not be used often, can it be worked around with a few lines of script?

Hopefully if people are looking up information on how to use threads they would like to be aware of common pitfalls and how to avoid them. It can be worked around with enough googling to find the answer buried in an issue tracker comment.

Is there a reason why this should be core and not an add-on in the asset library?

This is about improving documentation.

@Calinou Calinou transferred this issue from godotengine/godot-proposals Sep 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants