blocking on the main thread #17156
Unanswered
aharondavid
asked this question in
Q&A
Replies: 2 comments
-
Yes, in the general case you cannot block arbitrarily on the main thread, and that includes synchronously waiting for another thread to do something. In practice, there are many times that it is safe, for example if you know that the pthread you are waiting on will complete its work in short order. If only a deadlock if neither thread can make progress. For example, if the pthread is doing work that requires the main thread to turn its event loop, but the main thread is blocking without returning the event loop. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Ok, thanks |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
To avoid blocking on the main thread we pass most of the work to a Pthread.
suppose that other module (i.e UI event) has a call to this pthread, this call should be a sync call (without using the Asyncify because of performance and other issues).
isn't we getting to the same problem - blocking on the main thread ? how can we get over on such case ?
Beta Was this translation helpful? Give feedback.
All reactions