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

is their any pthread example #65

Closed
xalteropsx opened this issue Jan 27, 2025 · 3 comments
Closed

is their any pthread example #65

xalteropsx opened this issue Jan 27, 2025 · 3 comments

Comments

@xalteropsx
Copy link

xalteropsx commented Jan 27, 2025

emcc panda.cpp -o panda.wasm -pthread ?

cause i keep getting

wasmtime panda.wasm --enable-pthreads
Error: failed to run main module panda.wasm

Caused by:
0: failed to instantiate "panda.wasm"
1: unknown import: env::emscripten_check_blocking_allowed has not been defined

@alexcrichton
Copy link
Member

There's not currently any example at this time, no. Emscripten's toolchain has Emscripten-specific imports which will require you to implement if you're running outside of the Emscripten environment. I'm no expert on those myself, so I'm not sure what emscripten_check_blocking_allowed should do for example. My guess is you probably want to use a wasi-sdk toolchain instead to run outside of a browser.

In such a situation the wasip1-threads target can generate binaries but you'll have to build WASI threading yourself. Wasmtime's C API, currently intentionally, doesn't support wasi-threads.

@xalteropsx
Copy link
Author

xalteropsx commented Jan 27, 2025

ah alright thnx for super fast reply was really screwed with pthread

@xalteropsx
Copy link
Author

emscripten-core/emscripten#23506 tag incase if anyone came to see this might help him

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants