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

Multiple threads tutorial should use Image.load() as a useful example #4389

Open
goatchurchprime opened this issue Nov 19, 2020 · 0 comments
Labels
area:manual Issues and PRs related to the Manual/Tutorials section of the documentation enhancement

Comments

@goatchurchprime
Copy link

Your Godot version:
3.2.3.stable

Issue description:
I had an issue with the when a 7Mb jpg file of a satellite image took 450ms in load_jpg_from_buffer() for godot to uncompress/decode. This froze everything up and caused network polling problems.
See godotengine/godot#20056 (comment)

I think I fixed it by putting my Image loader into a thread.

At the moment the multiple threads tutorial page (link below) uses a completely contrived example of incrementing a counter.

It would be more useful if the example instead applied to decoding a big binary object (like a jpg) as this is likely to be the first application a programmer is going to be forced to use threads in godot for. My implementation is here.

Then you can have a hint on the Image.load() documentation that this can hang the system if it's a big file, but there is a solution. I do not think that ResourceInteractiveLoader helps here because (a) it doesn't apply to downloaded files in the user:// directory, and (b) that interactive loader will still call the image loading function as a single frame-hanging blob.

URL to the documentation page (if already existing):
https://docs.godotengine.org/en/stable/tutorials/threads/using_multiple_threads.html

See also #2148

@skyace65 skyace65 added the area:manual Issues and PRs related to the Manual/Tutorials section of the documentation label Dec 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:manual Issues and PRs related to the Manual/Tutorials section of the documentation enhancement
Projects
None yet
Development

No branches or pull requests

2 participants