Wenyong Huang

Results 350 comments of Wenyong Huang

Hi, so you create two threads in init(), then you should only call init() one time in the host native? And could you remove `pthread_detach(tid);` and `pthread_detach(tid1);`? A little confused...

OK, seems it isn't caused by pthread_detach, but it may be better to put the first `pthread_detach` after `NativeApp_Sleep(10)` and put the second `pthread_detach` after `NativeApi_sleep(100)`.

Not sure whether it is caused by wasi-sdk (its libc bytecode of malloc function), or is caused by wamr, could you try compile the wasm app with [wasi-sdk-20+threads](https://github.com/WebAssembly/wasi-sdk/releases/tag/wasi-sdk-20%2Bthreads)? Another way...

Hi, is it caused by wasm_runtime_module_malloc returning 0? Do yo pass `--heap-size=n` to iwasm, or if you are not using iwasm, could you pass host_managed_heap_size with a value larger than...

What `onDataRecv` does? Will `wasm_runtime_call_wasm(exec_env, onDataRecv, 2, argv)` send data to other thread, and other thread accesses it after this thread frees the data (`module_free(wasm_module_inst, wasmBuffer)`)? BTW, do you test...

Seems that `__wasm_call_ctors` isn't exported and executed to initialize the c++ class/struct related globals. Could you add `-Wl,--export=__wasm_call_ctors`, and then call it before calling the `init()` function, somewhat like: ```C...

I am not sure whether there is still issue in the latest wasi-sdk, but maybe you can try building wasi-libc by yourself: ``` git clone https://github.com/WebAssembly/wasi-libc cd wasi-libc make -j...

Could you please try removing `-DWAMR_BUILD_LIB_WASI_THREADS=1` (or set it to 0) and rebuild wamr first? And enlarge `-zstack-size=10485760` in target_link_options and call `wasm_runtime_set_max_thread_num(n)` with a larger `n` if needed.

Welcome, it is great that it works! Yes, you use WAMR lib-pthread but not wasi-threads, since the wasm app imports `pthread_create` and other pthread_xxx APIs, but not import `thread-spawn`. Refer...

It is because that these import functions are not linked, if you want, you can implement the related native API wrappers and register them to runtime with wasm_runtime_register_natives. But it...