aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueManager.cs
diff options
context:
space:
mode:
authorTedd Hansen2008-02-02 03:11:06 +0000
committerTedd Hansen2008-02-02 03:11:06 +0000
commite06ee9fd4bb60c95009af516d92786de2a88f859 (patch)
tree502e98629fded5adcc64ec705e566e57d930d324 /OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueManager.cs
parentAdded OpenSim.32BitLaunch.exe that can be used on 64-bit systems to run OpenS... (diff)
downloadopensim-SC_OLD-e06ee9fd4bb60c95009af516d92786de2a88f859.zip
opensim-SC_OLD-e06ee9fd4bb60c95009af516d92786de2a88f859.tar.gz
opensim-SC_OLD-e06ee9fd4bb60c95009af516d92786de2a88f859.tar.bz2
opensim-SC_OLD-e06ee9fd4bb60c95009af516d92786de2a88f859.tar.xz
Added load/unload queue size limit
Added option to share script load/unload thread between regions Added event execution queue size limit + some bugfixes from all the changes
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueManager.cs')
-rw-r--r--OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueManager.cs10
1 files changed, 10 insertions, 0 deletions
diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueManager.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueManager.cs
index fb20f40..7da2769 100644
--- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueManager.cs
+++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueManager.cs
@@ -99,6 +99,8 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
99 /// </summary> 99 /// </summary>
100 internal int numberOfThreads; 100 internal int numberOfThreads;
101 101
102 internal static int EventExecutionMaxQueueSize;
103
102 /// <summary> 104 /// <summary>
103 /// Maximum time one function can use for execution before we perform a thread kill. 105 /// Maximum time one function can use for execution before we perform a thread kill.
104 /// </summary> 106 /// </summary>
@@ -208,6 +210,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
208 maxFunctionExecutionTimems = m_ScriptEngine.ScriptConfigSource.GetInt("MaxEventExecutionTimeMs", 5000); 210 maxFunctionExecutionTimems = m_ScriptEngine.ScriptConfigSource.GetInt("MaxEventExecutionTimeMs", 5000);
209 EnforceMaxExecutionTime = m_ScriptEngine.ScriptConfigSource.GetBoolean("EnforceMaxEventExecutionTime", false); 211 EnforceMaxExecutionTime = m_ScriptEngine.ScriptConfigSource.GetBoolean("EnforceMaxEventExecutionTime", false);
210 KillScriptOnMaxFunctionExecutionTime = m_ScriptEngine.ScriptConfigSource.GetBoolean("DeactivateScriptOnTimeout", false); 212 KillScriptOnMaxFunctionExecutionTime = m_ScriptEngine.ScriptConfigSource.GetBoolean("DeactivateScriptOnTimeout", false);
213 EventExecutionMaxQueueSize = m_ScriptEngine.ScriptConfigSource.GetInt("EventExecutionMaxQueueSize", 300);
211 214
212 // Now refresh config in all threads 215 // Now refresh config in all threads
213 lock (eventQueueThreadsLock) 216 lock (eventQueueThreadsLock)
@@ -362,6 +365,13 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
362 { 365 {
363 lock (queueLock) 366 lock (queueLock)
364 { 367 {
368 if (eventQueue.Count >= EventExecutionMaxQueueSize)
369 {
370 m_ScriptEngine.Log.Error(m_ScriptEngine.ScriptEngineName, "ERROR: Event execution queue item count is at " + eventQueue.Count + ". Config variable \"EventExecutionMaxQueueSize\" is set to " + EventExecutionMaxQueueSize + ", so ignoring new event.");
371 m_ScriptEngine.Log.Error(m_ScriptEngine.ScriptEngineName, "Event ignored: localID: " + localID + ", itemID: " + itemID + ", FunctionName: " + FunctionName);
372 return;
373 }
374
365 // Create a structure and add data 375 // Create a structure and add data
366 QueueItemStruct QIS = new QueueItemStruct(); 376 QueueItemStruct QIS = new QueueItemStruct();
367 QIS.localID = localID; 377 QIS.localID = localID;