• Advertisement
Sign in to follow this  

Two (or more) Script Engine object possible?

This topic is 3566 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Is it possible to create two ore more AngelScript engines, and use them simultaneously? example: pEngine1 = asCreateScriptEngine(ANGELSCRIPT_VERSION); pEngine2 = asCreateScriptEngine(ANGELSCRIPT_VERSION); // pEngine3 ... if needed They are completely independent and one main thread will call them by turns. Is it also possible to use them in separate threads concurrently? Thanks in advance.

Share this post


Link to post
Share on other sites
Advertisement
Yes, it should be possible to have two script engines working in parallel. You'll need to make sure script objects aren't passed from one engine to another though, as an object implemented by one won't necessarily be understood by the other.

AngelScript has rudimentary support for multithreading on the Windows platform. You'll need to compile library with the preprocessor directive USE_THREADS set to add mutexes on critical parts of the code.

I recommend you look into dynamic configuration groups (BeginConfigGroup, etc). They allow you to use one script engine, yet expose different application interfaces to different script modules.

Regards,
Andreas

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement