Parallel / web workers

Aug 8, 2014 at 8:59 PM
Is there any support for parallelism or web workers in clearscript? I would like to do parallel processing within my javascript code instead of having .net facilitate it because of the overhead of creating the engine in each thread.

Do you have a roadmap you can share? If this isn't on it will you consider adding it?
Aug 9, 2014 at 10:19 AM
I'm not sure about the web workers (but I don't think they're already available).

Have you already considered using a pool of active ClearScript engines, so to avoid recreating engines at every new iteration?
Coordinator
Aug 10, 2014 at 5:19 PM
Edited Aug 11, 2014 at 12:15 PM
Greetings!

V8 doesn't support (and actually blocks) concurrent access to a given runtime, but the application can spin up multiple runtimes and access them concurrently. Windows script engines are similar but more limited in that each instance must always be accessed on the same thread that created it.

In any case, it isn't ClearScript's goal to provide application infrastructure beyond script engine integration. When it comes to concurrency, ClearScript doesn't dictate any specific model. Instead, it aims to make it easy to expose whatever model suits the application (or is already in use by the application) to script code, as long as it complies with the script engine's requirements.

Cheers!