Temporarily add root agent rez attachments work to job engine if it is running rather than as a fire and forget.

Experiment to see if serializing attachment rez and send initial data jobs improves other parts of sim performance.
mb-throttle-test
Justin Clark-Casey (justincc) 2014-09-09 18:26:41 +01:00
parent 859b1c5ba4
commit 9fb3065d33
2 changed files with 12 additions and 8 deletions

View File

@ -133,7 +133,7 @@ namespace OpenSim.Framework.Monitoring
/// /summary> /// /summary>
public static event Action<ThreadWatchdogInfo> OnWatchdogTimeout; public static event Action<ThreadWatchdogInfo> OnWatchdogTimeout;
private static JobEngine m_jobEngine; public static JobEngine JobEngine { get; private set; }
/// <summary> /// <summary>
/// Is this watchdog active? /// Is this watchdog active?
@ -175,7 +175,7 @@ namespace OpenSim.Framework.Monitoring
static Watchdog() static Watchdog()
{ {
m_jobEngine = new JobEngine(); JobEngine = new JobEngine();
m_threads = new Dictionary<int, ThreadWatchdogInfo>(); m_threads = new Dictionary<int, ThreadWatchdogInfo>();
m_watchdogTimer = new System.Timers.Timer(WATCHDOG_INTERVAL_MS); m_watchdogTimer = new System.Timers.Timer(WATCHDOG_INTERVAL_MS);
m_watchdogTimer.AutoReset = false; m_watchdogTimer.AutoReset = false;
@ -463,8 +463,8 @@ namespace OpenSim.Framework.Monitoring
return; return;
} }
if (m_jobEngine.IsRunning) if (JobEngine.IsRunning)
m_jobEngine.QueueRequest(name, callback, obj); JobEngine.QueueRequest(name, callback, obj);
else else
RunInThread(callback, name, obj, log); RunInThread(callback, name, obj, log);
} }

View File

@ -1228,10 +1228,14 @@ namespace OpenSim.Region.Framework.Scenes
// viewers without (e.g. v1 viewers) will not, so we still need to make this call. // viewers without (e.g. v1 viewers) will not, so we still need to make this call.
if (Scene.AttachmentsModule != null) if (Scene.AttachmentsModule != null)
{ {
Util.FireAndForget(o => if (Watchdog.JobEngine.IsRunning)
{ Watchdog.RunWhenPossible(
Scene.AttachmentsModule.RezAttachments(this); "RezAttachments",
}); o => Scene.AttachmentsModule.RezAttachments(this),
string.Format("Rez attachments for {0} in {1}", Name, Scene.Name),
null);
else
Util.FireAndForget(o => Scene.AttachmentsModule.RezAttachments(this));
} }
} }
else else