Multithreaded JavaScript usage
Combine this with our new EvaluateMT and CallFunctionMT methods and you can run various JavaScript codes on preemptive threads in the background and get all CPU cores busy. Our screenshot above shows 8 threads running the function to do the image effect 100 times.
Please makes sure the memory blocks are not released too early and you use one JavaScriptEngineMBS object per thread to keep things separated. If you access a JavaScriptEngineMBS object on two threads, we now raise an exception telling you the object is busy. Even if you use only one thread with one instance, you can keep your GUI responsive while JavaScript runs in background. Using Print and Input events or Xojo delegate method calls, it may talk to your main thread and the GUI.
Coming soon for next prerelease. Email us if you have questions or want to get early access to try it.
See also: Multithreaded plugin functions can increase speed of Xojo application, Xojo and JavaScript – A Perfect Combination, Tips for our JavaScript functions, Comparing JavaScriptEngineMBS to XojoScript and Our JavaScript engine for Xojo.