emscripten-core / emscripten-core/emscripten
Pthread doesn't start in my build
- Dominant language
- C++
- Stars
- 27.6k
- Forks
- 3.6k
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 105
Description
https://github.com/emscripten-core/emscripten/issues/19265
1、 -s PROXY_TO_PTHREAD
the application assumed main() was on the main browser thread, so need take some porting work,so what is the porting work ? Which ones need to be ported?
2、-sPTHREAD_POOL_SIZE=N
we dont know the user need how many threads. may be 2 , may be 30 ,so how can i set ?
3、or you can yield the event loops before trying to use new threads.
i pthread_create(&eventLoopThread->thread_tid, NULL, &event_loop_thread_run, eventLoopThread);
this means i need set event_loop_thread_rum is NULL when trying to use new threads ?
4、pthread_tryjoin_np + ASYNC(link)
(https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread)
I test the demo , find the number of workers is growing all the time, Finally the browser crashes.
the demo in
https://github.com/yangfangfang1204/graph
Contributor guide
Assessment
This issue has not been assessed yet.