blocking on the main thread #16960
Unanswered
aharondavid
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
according to https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread :
"Busy-waiting on the main browser thread in general will work despite the downsides just mentioned, for things like waiting on a lightly-contended mutex. However, things like pthread_join and pthread_cond_wait are often intended to block for long periods of time, and if that happens on the main browser thread, and while other threads expect it to respond, it can cause a surprising deadlock. That can happen because of proxying, see the previous section. If the main thread blocks while a worker attempts to proxy to it, a deadlock can occur."
is there an example for such potential dead lock?
I execute the following func in the main thread and I am not sure that it safe:
Beta Was this translation helpful? Give feedback.
All reactions