|
Hi ackava |
Answered by
ackava
Aug 15, 2022
Replies: 1 comment 1 reply
|
When you create JSContext from UI Thread, all operations will be performed on UI Thread, just like how JavaScript is executed on browser. JSContext isn't threadsafe, as JavaScript was itself designed to run on single thread. If you modify JSObject from other threads, it will lead to inconsistent results. But you can always queue your changes on the main thread. |
1 reply
Answer selected by
kitsunoff
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When you create JSContext from UI Thread, all operations will be performed on UI Thread, just like how JavaScript is executed on browser.
setTimeout,setIntervaland all proxy resolutions will execute on the UI Thread.JSContext isn't threadsafe, as JavaScript was itself designed to run on single thread. If you modify JSObject from other threads, it will lead to inconsistent results. But you can always queue your changes on the main thread.