YEngine
From OpenSimulator
(→Preemptive Multitasking) |
(→Preemptive Multitasking) |
||
Line 14: | Line 14: | ||
A script event can run for about 60ms releasing execution. Then on continuations it can run for about 30ms. (This times may change)<br> | A script event can run for about 60ms releasing execution. Then on continuations it can run for about 30ms. (This times may change)<br> | ||
The script can also be placed in a sleep state until a sleep time elapses.<br> | The script can also be placed in a sleep state until a sleep time elapses.<br> | ||
− | This, for example, solves one of XEngine worse problems: llSleep(). | + | This, for example, solves one of XEngine worse problems: llSleep() and other internal script sleeps. This just release execution and wait in a queue, until the sleep time expires. |
= Improved script syntax = | = Improved script syntax = |
Revision as of 18:35, 19 September 2020
Contents |
Summary
This is a fully functional alternative to XEngine for LSL/OSSL scripts, featuring
- Preemptive Multitasking
- Improved script syntax
- Memory heap and stack use control
- Optional new language extensions
Preemptive Multitasking
YEngine executes script events using preemptive multitasking.
This means that, at certain control points or when told, a script may release execution, waiting in a queue until it is its turn to execute again.
The released execution thread goes on processing other scripts.
A script event can run for about 60ms releasing execution. Then on continuations it can run for about 30ms. (This times may change)
The script can also be placed in a sleep state until a sleep time elapses.
This, for example, solves one of XEngine worse problems: llSleep() and other internal script sleeps. This just release execution and wait in a queue, until the sleep time expires.
Improved script syntax
YEngine follows more closely LSL script syntax and execution order. statements like
if(oneKey) ...
should now work.
llSomething; // missing() break; // but see new extensions
are now errors
complex statements execution order may be different from XEngine. One should always use (..) to enforce it the wanted order! (and in any language)
New language extensions
This information is relative to version Yeti 0.9.2.0 Dev, with older version use only normal LSL
If the first or second line of a script is (first line can still be script engine and language selection)
yoptions;
Yengine specific language extensions are activated
Scripts using this features will not compile or run on XEngine.
Memory heap and stack use control
Yengine keeps control of the memory a script uses.
There are two types of memory:
- Stack holds function arguments and simple local variables.
- Heap holds global variables and complex variables like lists or strings, even if they are local to a method/event.
the maximum values a script can use can be configured in OpenSim.Ini section [YEngine]
; maximum stack a script can use in KB ;ScriptStackSize = 2048 ; maximum heap memory a script can use in KB ;ScriptHeapSize = 1024
you may need to increase this values
Activation
Opensimulation default configuration selects XEngine. To change to YEngine you need to change OpenSim.ini:
[Startup] section:
DefaultScriptEngine = "YEngine"
[Yengine] section:
Enable = true
[Xengine] section:
Enable = false
Note: in theory, opensimulator could run several engines at same time, but we should not do that with X and Y engines.