Sign in to follow this  
shkim

Two (or more) Script Engine object possible?

Recommended Posts

shkim    122
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
WitchLord    4677
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this