YEngine
From OpenSimulator
(→New language extensions) |
m (Minor English imporvements) |
||
Line 12: | Line 12: | ||
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.<br> | 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.<br> | ||
The released execution thread goes on processing other scripts.<br> | The released execution thread goes on processing other scripts.<br> | ||
− | A script event can run for about 60ms until releasing execution. Then on continuations it can run for about 30ms. ( | + | A script event can run for about 60ms until releasing execution. Then on continuations it can run for about 30ms. (These times may change).<br> |
− | The script can also be placed in a sleep state until a sleep time | + | The script can also be placed in a sleep state until a sleep time lapses.<br> |
− | This, for example, solves one of XEngine worse problems: llSleep() and other internal script sleeps. On YEngine, this just | + | 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. |
= Improved script syntax = | = Improved script syntax = | ||
Line 29: | Line 29: | ||
are now errors | are now errors | ||
− | + | Complex statements execution order may be different from XEngine. One should always use parentheses (...) to enforce the order wanted (and in any language)! | |
= New language extensions = | = New language extensions = | ||
Line 49: | Line 49: | ||
− | Scripts using | + | Scripts using these features will not compile or run on XEngine. |
= Memory heap and stack use control = | = Memory heap and stack use control = | ||
Line 57: | Line 57: | ||
* Heap holds global variables and complex variables like lists or strings, even if they are local to a method/event.<br> | * Heap holds global variables and complex variables like lists or strings, even if they are local to a method/event.<br> | ||
− | + | The maximum memory a script can use can be configured in the OpenSim.ini section [YEngine] | |
; maximum stack a script can use in KB | ; maximum stack a script can use in KB | ||
Line 66: | Line 66: | ||
− | + | You may need to increase these values | |
= Activation = | = Activation = | ||
− | + | OpenSimulator default configuration selects XEngine. To change to YEngine you need to change OpenSim.ini:<br> | |
[Startup] section: | [Startup] section: | ||
Line 83: | Line 83: | ||
− | Note: in theory, | + | Note: in theory, OpenSimulator could run several engines at the same time, but we should not do that with X and Y engines. |
= Configuration = | = Configuration = | ||
Please see file OpenSimDefaults.ini, section [YEngine] for details.<br> | Please see file OpenSimDefaults.ini, section [YEngine] for details.<br> | ||
− | + | As in all case, if you need to change something, copy respective lines to similar location on file OpenSim.ini, and change there | |
= Origins = | = Origins = | ||
− | YEngine is a modified derivative of XMREngine<br> | + | YEngine is a modified derivative of XMREngine.<br> |
− | XMREngine was developed by teams of DreamNation and Avination grids. With early work from Meta<br> | + | XMREngine was developed by teams of DreamNation and Avination grids. With early work from Meta.<br> |
− | It is still in use by DreamNation<br> | + | It is still in use by DreamNation.<br> |
http://wiki.dreamnation.net/index.php/XMREngine_Script_Engine | http://wiki.dreamnation.net/index.php/XMREngine_Script_Engine | ||
− | A lot of information about XMREngine no longer applies to YEngine. Some features may still work, but may be removed or changed | + | A lot of information about XMREngine no longer applies to YEngine. Some features may still work, but may be removed or changed. |
Revision as of 00:48, 20 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 per script
- 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 until releasing execution. Then on continuations it can run for about 30ms. (These times may change).
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.
Improved script syntax
YEngine follows more closely the 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 parentheses (...) to enforce the order wanted (and in any language)!
New language extensions
This information is relative to version Yeti 0.9.2.0 Dev, with older version use just only normal LSL/OSSL
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 these 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 memory a script can use can be configured in the 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 these values
Activation
OpenSimulator 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 the same time, but we should not do that with X and Y engines.
Configuration
Please see file OpenSimDefaults.ini, section [YEngine] for details.
As in all case, if you need to change something, copy respective lines to similar location on file OpenSim.ini, and change there
Origins
YEngine is a modified derivative of XMREngine.
XMREngine was developed by teams of DreamNation and Avination grids. With early work from Meta.
It is still in use by DreamNation.
http://wiki.dreamnation.net/index.php/XMREngine_Script_Engine
A lot of information about XMREngine no longer applies to YEngine. Some features may still work, but may be removed or changed.