YEngine: change some startup log messages

0.9.1.1
UbitUmarov 2019-11-22 07:42:00 +00:00
parent 943d0935a6
commit 2a508edcb4
2 changed files with 25 additions and 23 deletions

View File

@ -122,7 +122,7 @@ namespace OpenSim.Region.ScriptEngine.Yengine
public XMRInstQueue m_YieldQueue = new XMRInstQueue(); public XMRInstQueue m_YieldQueue = new XMRInstQueue();
public XMRInstQueue m_SleepQueue = new XMRInstQueue(); public XMRInstQueue m_SleepQueue = new XMRInstQueue();
private string m_LockedDict = "nobody"; private string m_LockedDict = "nobody";
private ThreadPriority m_workersPrio;
public Yengine() public Yengine()
{ {
} }
@ -250,43 +250,29 @@ namespace OpenSim.Region.ScriptEngine.Yengine
return; return;
} }
ThreadPriority workersPrio = ThreadPriority.Normal; m_workersPrio = ThreadPriority.Normal;
switch (priority) switch (priority)
{ {
case "Lowest": case "Lowest":
workersPrio = ThreadPriority.Lowest; m_workersPrio = ThreadPriority.Lowest;
break; break;
case "BelowNormal": case "BelowNormal":
workersPrio = ThreadPriority.BelowNormal; m_workersPrio = ThreadPriority.BelowNormal;
break; break;
case "Normal": case "Normal":
workersPrio = ThreadPriority.Normal; m_workersPrio = ThreadPriority.Normal;
break; break;
case "AboveNormal": case "AboveNormal":
workersPrio = ThreadPriority.AboveNormal; m_workersPrio = ThreadPriority.AboveNormal;
break; break;
case "Highest": case "Highest":
workersPrio = ThreadPriority.Highest; m_workersPrio = ThreadPriority.Highest;
break; break;
default: default:
m_log.ErrorFormat("[YEngine] Invalid thread priority: '{0}'. Assuming Normal", priority); m_log.ErrorFormat("[YEngine] Invalid thread priority: '{0}'. Assuming Normal", priority);
break; break;
} }
m_SleepThread = StartMyThread(RunSleepThread, "Yengine sleep", ThreadPriority.Normal);
for(int i = 0; i < numThreadScriptWorkers; i++)
StartThreadWorker(i, workersPrio);
m_log.InfoFormat("[YEngine]: Enabled, {0}.{1} Meg (0x{2}) stacks",
(m_StackSize >> 20).ToString(),
(((m_StackSize % 0x100000) * 1000)
>> 20).ToString("D3"),
m_StackSize.ToString("X"));
m_log.InfoFormat("[YEngine]: ... {0}.{1} Meg (0x{2}) heaps",
(m_HeapSize >> 20).ToString(),
(((m_HeapSize % 0x100000) * 1000)
>> 20).ToString("D3"),
m_HeapSize.ToString("X"));
m_MaintenanceInterval = m_Config.GetInt("MaintenanceInterval", 10); m_MaintenanceInterval = m_Config.GetInt("MaintenanceInterval", 10);
@ -323,6 +309,22 @@ namespace OpenSim.Region.ScriptEngine.Yengine
Directory.CreateDirectory(m_ScriptBasePath); Directory.CreateDirectory(m_ScriptBasePath);
string sceneName = m_Scene.Name;
m_log.InfoFormat("[YEngine]: Enabled for region {0}", sceneName);
m_log.InfoFormat("[YEngine]: {0}.{1}MB stacksize, {2}.{3}MB heapsize",
(m_StackSize >> 20).ToString(),
(((m_StackSize % 0x100000) * 1000)
>> 20).ToString("D3"),
(m_HeapSize >> 20).ToString(),
(((m_HeapSize % 0x100000) * 1000)
>> 20).ToString("D3"));
m_SleepThread = StartMyThread(RunSleepThread, "Yengine sleep" + " (" + sceneName + ")", ThreadPriority.Normal);
for (int i = 0; i < numThreadScriptWorkers; i++)
StartThreadWorker(i, m_workersPrio, sceneName);
m_Scene.EventManager.OnRezScript += OnRezScript; m_Scene.EventManager.OnRezScript += OnRezScript;
m_Scene.StackModuleInterface<IScriptModule>(this); m_Scene.StackModuleInterface<IScriptModule>(this);

View File

@ -56,11 +56,11 @@ namespace OpenSim.Region.ScriptEngine.Yengine
} }
} }
public void StartThreadWorker(int i, ThreadPriority priority) public void StartThreadWorker(int i, ThreadPriority priority, string sceneName)
{ {
Thread thd; Thread thd;
if(i >= 0) if(i >= 0)
thd = Yengine.StartMyThread(RunScriptThread, "YScript" + i.ToString(), priority); thd = Yengine.StartMyThread(RunScriptThread, "YScript" + i.ToString() + " (" + sceneName +")", priority);
else else
thd = Yengine.StartMyThread(RunScriptThread, "YScript", priority); thd = Yengine.StartMyThread(RunScriptThread, "YScript", priority);
lock(m_WakeUpLock) lock(m_WakeUpLock)