Two (or more) Script Engine object possible?
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.
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
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
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement