diff options
author | Justin Clark-Casey (justincc) | 2014-09-09 18:14:56 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2014-11-25 23:18:37 +0000 |
commit | 859b1c5ba41198c57e1e84cf6bbf3e3634cc3d58 (patch) | |
tree | 93cf2e0e2c8b9c5c13e30f142420db73a2b780a3 /OpenSim/Framework/Monitoring/Watchdog.cs | |
parent | Temporary hack to disable av to av collisions in bulletsim. (diff) | |
download | opensim-SC_OLD-859b1c5ba41198c57e1e84cf6bbf3e3634cc3d58.zip opensim-SC_OLD-859b1c5ba41198c57e1e84cf6bbf3e3634cc3d58.tar.gz opensim-SC_OLD-859b1c5ba41198c57e1e84cf6bbf3e3634cc3d58.tar.bz2 opensim-SC_OLD-859b1c5ba41198c57e1e84cf6bbf3e3634cc3d58.tar.xz |
Add experimental job engine to see if queueing some existing async work during root agent entry to a region improves perf rather than always attempting to execute everything concurrently
Job engine is controlled via "debug jobengine start|stop|status".
Can only currently be enabled and disabled dynamically at runtime.
Currently only applies to code sending initial region data (objects, other avatar data) to a client.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Framework/Monitoring/Watchdog.cs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/OpenSim/Framework/Monitoring/Watchdog.cs b/OpenSim/Framework/Monitoring/Watchdog.cs index 0fcb195..b00aa5c 100644 --- a/OpenSim/Framework/Monitoring/Watchdog.cs +++ b/OpenSim/Framework/Monitoring/Watchdog.cs | |||
@@ -133,6 +133,8 @@ namespace OpenSim.Framework.Monitoring | |||
133 | /// /summary> | 133 | /// /summary> |
134 | public static event Action<ThreadWatchdogInfo> OnWatchdogTimeout; | 134 | public static event Action<ThreadWatchdogInfo> OnWatchdogTimeout; |
135 | 135 | ||
136 | private static JobEngine m_jobEngine; | ||
137 | |||
136 | /// <summary> | 138 | /// <summary> |
137 | /// Is this watchdog active? | 139 | /// Is this watchdog active? |
138 | /// </summary> | 140 | /// </summary> |
@@ -173,6 +175,7 @@ namespace OpenSim.Framework.Monitoring | |||
173 | 175 | ||
174 | static Watchdog() | 176 | static Watchdog() |
175 | { | 177 | { |
178 | m_jobEngine = new JobEngine(); | ||
176 | m_threads = new Dictionary<int, ThreadWatchdogInfo>(); | 179 | m_threads = new Dictionary<int, ThreadWatchdogInfo>(); |
177 | m_watchdogTimer = new System.Timers.Timer(WATCHDOG_INTERVAL_MS); | 180 | m_watchdogTimer = new System.Timers.Timer(WATCHDOG_INTERVAL_MS); |
178 | m_watchdogTimer.AutoReset = false; | 181 | m_watchdogTimer.AutoReset = false; |
@@ -450,5 +453,20 @@ namespace OpenSim.Framework.Monitoring | |||
450 | 453 | ||
451 | m_watchdogTimer.Start(); | 454 | m_watchdogTimer.Start(); |
452 | } | 455 | } |
456 | |||
457 | public static void RunWhenPossible(string jobType, WaitCallback callback, string name, object obj, bool log = false) | ||
458 | { | ||
459 | if (Util.FireAndForgetMethod == FireAndForgetMethod.RegressionTest) | ||
460 | { | ||
461 | Culture.SetCurrentCulture(); | ||
462 | callback(obj); | ||
463 | return; | ||
464 | } | ||
465 | |||
466 | if (m_jobEngine.IsRunning) | ||
467 | m_jobEngine.QueueRequest(name, callback, obj); | ||
468 | else | ||
469 | RunInThread(callback, name, obj, log); | ||
470 | } | ||
453 | } | 471 | } |
454 | } \ No newline at end of file | 472 | } \ No newline at end of file |