-
Hi ackava |
Beta Was this translation helpful? Give feedback.
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. |
Beta Was this translation helpful? Give feedback.
When you create JSContext from UI Thread, all operations will be performed on UI Thread, just like how JavaScript is executed on browser.
setTimeout
,setInterval
and 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.