-
-
Notifications
You must be signed in to change notification settings - Fork 224
Sending Godot Objects across threads #150
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
Comments
Yes, this is planned in #18 🙂 Unlike the GDNative binding, I would like to take a slightly different approach, allowing safe use where possible. This has of course some caveats, and can likely not be done for most Godot types, as they're not thread-safe. Later I will close this issue as a duplicate, but I would appreciate if you could elaborate your use case a bit! You mentioned objects that you constructed in your own code? |
My current use case is the following: So far, I was able to port the module from |
Thanks for elaborating! I don't think it will be possible to send Probably, this would need something like If you're currently blocked by this, you can always cheat and route the object through GDScript, either with method calls, or by storing it in a certain position of the scene tree (in the old thread) and accessing it there (in the new thread). This is still thread-unsafe, but outside godot-rust's safety responsibility. |
After attempting to work around my issue via some GDScript resource, I noticed that I'm taking all my input as Godot Dictionaries. Dictionaries were |
Dictionaries may be |
Closing in favor of #18. |
In
gdnative
it was possible to send engine objects across threads depending on the associated ownership. Ingdextension
on the other hand, it is currently not possible to move objects between threads. From the current implementation, it looks like all godot classes have deliberately been made!Send
.Are there already plans to provide a similar mechanic as in
gdnative
? I would really need to send objects across threads, especially ones that I have constructed in my own code and have exclusive access to.The text was updated successfully, but these errors were encountered: