Two (or more) Script Engine object possible?

Started by
0 comments, last by WitchLord 15 years, 11 months ago
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.
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

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

This topic is closed to new replies.

Advertisement