diff options
-rw-r--r-- | OpenSim/Region/ScriptEngine/YEngine/XMREngine.cs | 28 | ||||
-rw-r--r-- | OpenSim/Region/ScriptEngine/YEngine/XMRScriptThread.cs | 6 | ||||
-rw-r--r-- | bin/OpenSim.ini.example | 9 | ||||
-rw-r--r-- | bin/OpenSimDefaults.ini | 27 |
4 files changed, 57 insertions, 13 deletions
diff --git a/OpenSim/Region/ScriptEngine/YEngine/XMREngine.cs b/OpenSim/Region/ScriptEngine/YEngine/XMREngine.cs index d2b4ebd..5dcaa8f 100644 --- a/OpenSim/Region/ScriptEngine/YEngine/XMREngine.cs +++ b/OpenSim/Region/ScriptEngine/YEngine/XMREngine.cs | |||
@@ -207,8 +207,8 @@ namespace OpenSim.Region.ScriptEngine.Yengine | |||
207 | if(!m_Enabled) | 207 | if(!m_Enabled) |
208 | return; | 208 | return; |
209 | 209 | ||
210 | numThreadScriptWorkers = m_Config.GetInt("NumThreadScriptWorkers", 1); | 210 | numThreadScriptWorkers = m_Config.GetInt("NumThreadScriptWorkers", 2); |
211 | 211 | string priority = m_Config.GetString("Priority", "Normal"); | |
212 | m_TraceCalls = m_Config.GetBoolean("TraceCalls", false); | 212 | m_TraceCalls = m_Config.GetBoolean("TraceCalls", false); |
213 | m_Verbose = m_Config.GetBoolean("Verbose", false); | 213 | m_Verbose = m_Config.GetBoolean("Verbose", false); |
214 | m_ScriptDebug = m_Config.GetBoolean("ScriptDebug", false); | 214 | m_ScriptDebug = m_Config.GetBoolean("ScriptDebug", false); |
@@ -250,9 +250,31 @@ namespace OpenSim.Region.ScriptEngine.Yengine | |||
250 | return; | 250 | return; |
251 | } | 251 | } |
252 | 252 | ||
253 | ThreadPriority workersPrio = ThreadPriority.Normal; | ||
254 | switch (priority) | ||
255 | { | ||
256 | case "Lowest": | ||
257 | workersPrio = ThreadPriority.Lowest; | ||
258 | break; | ||
259 | case "BelowNormal": | ||
260 | workersPrio = ThreadPriority.BelowNormal; | ||
261 | break; | ||
262 | case "Normal": | ||
263 | workersPrio = ThreadPriority.Normal; | ||
264 | break; | ||
265 | case "AboveNormal": | ||
266 | workersPrio = ThreadPriority.AboveNormal; | ||
267 | break; | ||
268 | case "Highest": | ||
269 | workersPrio = ThreadPriority.Highest; | ||
270 | break; | ||
271 | default: | ||
272 | m_log.ErrorFormat("[YEngine] Invalid thread priority: '{0}'. Assuming Normal", priority); | ||
273 | break; | ||
274 | } | ||
253 | m_SleepThread = StartMyThread(RunSleepThread, "Yengine sleep", ThreadPriority.Normal); | 275 | m_SleepThread = StartMyThread(RunSleepThread, "Yengine sleep", ThreadPriority.Normal); |
254 | for(int i = 0; i < numThreadScriptWorkers; i++) | 276 | for(int i = 0; i < numThreadScriptWorkers; i++) |
255 | StartThreadWorker(i); | 277 | StartThreadWorker(i, workersPrio); |
256 | 278 | ||
257 | m_log.InfoFormat("[YEngine]: Enabled, {0}.{1} Meg (0x{2}) stacks", | 279 | m_log.InfoFormat("[YEngine]: Enabled, {0}.{1} Meg (0x{2}) stacks", |
258 | (m_StackSize >> 20).ToString(), | 280 | (m_StackSize >> 20).ToString(), |
diff --git a/OpenSim/Region/ScriptEngine/YEngine/XMRScriptThread.cs b/OpenSim/Region/ScriptEngine/YEngine/XMRScriptThread.cs index f68fd51..c71eb81 100644 --- a/OpenSim/Region/ScriptEngine/YEngine/XMRScriptThread.cs +++ b/OpenSim/Region/ScriptEngine/YEngine/XMRScriptThread.cs | |||
@@ -56,13 +56,13 @@ namespace OpenSim.Region.ScriptEngine.Yengine | |||
56 | } | 56 | } |
57 | } | 57 | } |
58 | 58 | ||
59 | public void StartThreadWorker(int i) | 59 | public void StartThreadWorker(int i, ThreadPriority priority) |
60 | { | 60 | { |
61 | Thread thd; | 61 | Thread thd; |
62 | if(i >= 0) | 62 | if(i >= 0) |
63 | thd = Yengine.StartMyThread(RunScriptThread, "YScript" + i.ToString(), ThreadPriority.BelowNormal); | 63 | thd = Yengine.StartMyThread(RunScriptThread, "YScript" + i.ToString(), priority); |
64 | else | 64 | else |
65 | thd = Yengine.StartMyThread(RunScriptThread, "YScript", ThreadPriority.BelowNormal); | 65 | thd = Yengine.StartMyThread(RunScriptThread, "YScript", priority); |
66 | lock(m_WakeUpLock) | 66 | lock(m_WakeUpLock) |
67 | m_RunningInstances.Add(thd.ManagedThreadId, null); | 67 | m_RunningInstances.Add(thd.ManagedThreadId, null); |
68 | } | 68 | } |
diff --git a/bin/OpenSim.ini.example b/bin/OpenSim.ini.example index 33b2819..04a4f7d 100644 --- a/bin/OpenSim.ini.example +++ b/bin/OpenSim.ini.example | |||
@@ -933,17 +933,12 @@ | |||
933 | ; PriceGroupCreate = 0 | 933 | ; PriceGroupCreate = 0 |
934 | 934 | ||
935 | [YEngine] | 935 | [YEngine] |
936 | ;; experimental engine | ||
937 | ;; implements non preemptive microthreading, so fixing problems like llSleep or long events handlers | 936 | ;; implements non preemptive microthreading, so fixing problems like llSleep or long events handlers |
938 | ;; but those will suffer from timeslicing, so will be slower. | 937 | ;; but those will suffer from timeslicing, so will be slower. |
939 | ;; warning: scripts state is lost on TP or cross to Xengine regions (cars stop, etc) | 938 | ;; warning: scripts state is lost on TP or cross to Xengine regions (cars stop, etc) |
940 | ;; ignore its extensions (subset of original XMRengine), those are still undefined. | 939 | ;; ignore its extensions (subset of original XMRengine), those are still undefined. |
941 | Enabled = false | 940 | ; Enabled = false |
942 | ScriptStackSize = 256 | 941 | |
943 | ScriptHeapSize = 256 | ||
944 | UseSourceHashCode = true | ||
945 | MinTimerInterval = 0.1 | ||
946 | ;ScriptBasePath="ScriptEngines" | ||
947 | 942 | ||
948 | [XEngine] | 943 | [XEngine] |
949 | ;# {Enabled} {} {Enable the XEngine scripting engine?} {true false} true | 944 | ;# {Enabled} {} {Enable the XEngine scripting engine?} {true false} true |
diff --git a/bin/OpenSimDefaults.ini b/bin/OpenSimDefaults.ini index d5a13cf..5d99110 100644 --- a/bin/OpenSimDefaults.ini +++ b/bin/OpenSimDefaults.ini | |||
@@ -1750,6 +1750,33 @@ | |||
1750 | ; MeshModelAllowTextureToInventory = true | 1750 | ; MeshModelAllowTextureToInventory = true |
1751 | 1751 | ||
1752 | 1752 | ||
1753 | [YEngine] | ||
1754 | ;; implements non preemptive microthreading, so fixing problems like llSleep or long events handlers | ||
1755 | ;; but those will suffer from timeslicing, so will be slower. | ||
1756 | ;; warning: scripts state is lost on TP or cross to Xengine regions (cars stop, etc) | ||
1757 | ;; ignore its extensions (subset of original XMRengine), those are still undefined. | ||
1758 | ;Enabled = false | ||
1759 | |||
1760 | ; maximum stack a script can use in KB | ||
1761 | ;ScriptStackSize = 2048 | ||
1762 | |||
1763 | ; maximum heap memory a script can use in KB | ||
1764 | ;ScriptHeapSize = 1024 | ||
1765 | |||
1766 | ; number of threads to execute script. Too many threads can have negative impact on other region operations | ||
1767 | ;NumThreadScriptWorkers = 2 | ||
1768 | |||
1769 | ; Priority of those threads (Lowest, BelowNormal, Normal, AboveNormal or Highest). Higher priorit can have negative impact on other region operations | ||
1770 | ;Priority = Normal | ||
1771 | |||
1772 | ; to reuse binary compare sources using a hash codes of them or full text | ||
1773 | UseSourceHashCode = true | ||
1774 | |||
1775 | MinTimerInterval = 0.1 | ||
1776 | |||
1777 | ; scripts states and cache parent folder location | ||
1778 | ;ScriptBasePath="ScriptEngines" | ||
1779 | |||
1753 | 1780 | ||
1754 | [XEngine] | 1781 | [XEngine] |
1755 | ; Enable this engine in this OpenSim instance | 1782 | ; Enable this engine in this OpenSim instance |