-
Notifications
You must be signed in to change notification settings - Fork 0
YEngine
Welcome to the YEngineWiki wiki!
This is a fully functional alternative to XEngine for LSL/OSSL scripts, featuring
* Preemptive Multitasking
* Improved script syntax
* Expressions evaluation order closer to original LSL specification
* Memory heap and stack use control per script
* Optional new language extensions
YEngine does direct translation from script language to .net IL code, this makes it compile faster than XEngine. XEngine translates script language to C#, and then uses .net compiler to generate IL, this is naturally slower. While XEngine could compile scripts in other languages like C#, YEngine only supports LSL. Due to security issues, those other languages could not be actually used, except on very special and restricted cases.
Once a script code is loaded on XEngine, the memory used by it can not be recovered whne the script is deleted, unless a .net feature called AppDomains are used But AppDomains are very heavy, use a lot more memory and worse, have a huge negative impact on scripts performance On calls crossing domains ( ie the script and main framework) all parameters and return values are serialized and deserialized by sender and receiver domains.
Yengine loads scripts code in a diferent way, most their memory is recovered on delete without the need for those AppDomains.
YEngine executes script events using preemptive multitasking. This means that, at certain control points or when told, a script may release execution, being placed on a queue waiting for its turn to execute again. The released execution thread goes on processing other scripts.
When a new event started execution, it will be allowed to run for about 60ms (subject to change) until releasing execution. When it is is turn to execute again it will be allowed to run for another 30ms(subject to change). This will be repeated until all the event code is executed Engine will give more priority to short fast events.
The script can also be placed in a sleep state until a sleep time lapses. This, for example, solves one of XEngine worse problems: llSleep() and other internal script sleeps. On YEngine, this just releases execution and waits in a queue, until the sleep time expires. On XEngine an "expensive" execution thread was placed in Sleep mode, so not available to do anything.
YEngine follows more closely the LSL script syntax and execution order. statements like
lsk if(oneKey) ...
should now work.
lsl llSomething; // missing() break; // but see new extensions
are now errors