microsoft / Chakra-Samples

Repository for Chakra JavaScript engine related samples.
MIT License
216 stars 84 forks source link

Multiple js contexts #8

Closed SrinivasGourarum closed 8 years ago

SrinivasGourarum commented 8 years ago

We have a requirement to run multiple js threads. I have created two js contexts on the same runtime. When trying to run on the second js context, there is an exception stating that the run time is active on another thread. Do I need to create a runtime for each js thread?

liminzhu commented 8 years ago

In general JSRT runtimes are rental-threaded, meaning that at any given time, a runtime can only be active on one thread, although you're free to move runtime between threads. If you need to run two js threads concurrently, then yes, you need to create two js runtimes.

SrinivasGourarum commented 8 years ago

Thank you.