Skip to content

YantraJS is thread-safe? #55

Answered by ackava
ZverGuy asked this question in Q&A
Aug 15, 2022 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

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.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ZverGuy
Comment options

Answer selected by ZverGuy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants