-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Thread is not working in WebAssembly export #12699
Comments
cc @eska014 |
Threads are not in the WASM spec yet, work is ongoing here: https://github.com/webassembly/threads |
Is there any way of getting similar functionality to threading. I'm trying to avoid HTTP requests from blocking the main thread? |
you could write a module that uses a javascript worker natively
…On Mon, Nov 6, 2017 at 10:51 AM, stubbsy345 ***@***.***> wrote:
Is there any way of getting similar functionality to threading. I'm trying
to avoid HTTP requests from blocking the main thread?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#12699 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AF-Z20ELN8NMzqcT3TnVU-zjxnnOINXgks5szw77gaJpZM4QTGbf>
.
|
In the meantime, I'm pretty sure I've seen a way to use |
Modern Chrome supports threads & "Shared Array Buffer" by default ( https://developers.google.com/web/updates/2018/10/wasm-threads ) NOTE: when using USE_PTHREADS don`t block main loop, prefer emscripten_run_in_main_loop/thread emscripten-core/emscripten#7535
|
Can anyone still reproduce this bug in Godot 3.2.3 or any later release? |
@KoBeWi Yes, as HTML5 thread support isn't implemented in a stable Godot release yet. Browser support for WebAssembly threads is still not fully reliable yet either, especially on mobile platforms. |
Well this is fixed, threads are supported and working in HTML5 with a custom build ( 3.2.4 will probably ship with both thread and no-thread templates to select at export. |
I just gave https://godotengine.org/article/dev-snapshot-godot-3-2-4-beta-3 a try to see how it works and I'm not sure how to enable threads? I don't see an option for it in the export though. Do I need to do something special, am I blind or something else? |
@lenscas as @akien-mga mentioned, thread support requires a custom build for now. |
I'm using stable 3.4 and still running into the same issue. Threads for web are not enabled automatically and I cannot find any option for it in the export options either. |
Threads still need to be enabled on export by changing Export Type in the HTML5 export preset: See Exporting for the web as for why HTML5 threads are disabled by default. Using both threads and GDNative at the same time may be supported in a future release, but 3.4.x doesn't support that. |
Mono templates can't be built with threading support sadly. It's available for non-Mono builds. Likewise for GDNative support Also, thus issue dates back to before threading support was even implemented. Please open new issues when so many years have passed. |
I came to this thread from #34506 which was referencing this as a solution for C# threading issues. I'm basically just looking for a way to use async/await in C# and export something that works for web. |
@blackears as I mentioned in #34506 (comment) the mono version do not support threads, because the mono version we use do not support modern emscripten versions. |
Why does Godot offer an option if that option isn't real? |
@ashelleyPurdue There are a LOT of things that do NOT work in some combination of export platform/renderers |
Operating system or device, Godot version, GPU Model and driver (if graphics related):
Godot alpha 2 Webassembly export.
Thread does not work in WebAssembly, I am conscious that may be because it is not possible to thread on this medium. But can't find anything stating that.
Works fine when not using a thread in webassembly.
The text was updated successfully, but these errors were encountered: