aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework
diff options
context:
space:
mode:
authorUbitUmarov2018-12-28 13:52:59 +0000
committerUbitUmarov2018-12-28 13:52:59 +0000
commit4a73cc81dc4e03b2b7c46829cecfc0627c3fddb4 (patch)
tree6e8200b3b7a3c0465853e42bbd790a59ccd4e312 /OpenSim/Framework
parentupdate pbs (diff)
downloadopensim-SC-4a73cc81dc4e03b2b7c46829cecfc0627c3fddb4.zip
opensim-SC-4a73cc81dc4e03b2b7c46829cecfc0627c3fddb4.tar.gz
opensim-SC-4a73cc81dc4e03b2b7c46829cecfc0627c3fddb4.tar.bz2
opensim-SC-4a73cc81dc4e03b2b7c46829cecfc0627c3fddb4.tar.xz
now break several things at same time... sog/sop updates, threads options,...
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/IClientAPI.cs18
-rw-r--r--OpenSim/Framework/Monitoring/WorkManager.cs68
2 files changed, 28 insertions, 58 deletions
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs
index 1c042c4..9617505 100644
--- a/OpenSim/Framework/IClientAPI.cs
+++ b/OpenSim/Framework/IClientAPI.cs
@@ -683,9 +683,16 @@ namespace OpenSim.Framework
683 ExtraData = 1 << 20, 683 ExtraData = 1 << 20,
684 Sound = 1 << 21, 684 Sound = 1 << 21,
685 Joint = 1 << 22, 685 Joint = 1 << 22,
686 FullUpdate = 0x0fffffff, 686
687 SendInTransit = 0x20000000, 687 TerseUpdate = Position | Rotation | Velocity | Acceleration | AngularVelocity,
688 CancelKill = 0x4fffffff, // 1 << 30 688 FullUpdate = 0x00ffffff,
689
690 Animations = 1 << 24,
691
692 FullUpdatewithAnim = FullUpdate | Animations,
693
694 SendInTransit = 0x20000000, // 1 << 29
695 CancelKill = 0x41ffffff, // 1 << 30
689 Kill = 0x80000000 // 1 << 31 696 Kill = 0x80000000 // 1 << 31
690 } 697 }
691 698
@@ -736,9 +743,6 @@ namespace OpenSim.Framework
736 743
737 List<uint> SelectedObjects { get; } 744 List<uint> SelectedObjects { get; }
738 745
739 // [Obsolete("LLClientView Specific - Replace with ???")]
740 int NextAnimationSequenceNumber { get; }
741
742 /// <summary> 746 /// <summary>
743 /// Returns the full name of the agent/avatar represented by this client 747 /// Returns the full name of the agent/avatar represented by this client
744 /// </summary> 748 /// </summary>
@@ -765,6 +769,8 @@ namespace OpenSim.Framework
765 769
766 bool SendLogoutPacketWhenClosing { set; } 770 bool SendLogoutPacketWhenClosing { set; }
767 771
772 int NextAnimationSequenceNumber {get; set;}
773
768 // [Obsolete("LLClientView Specific - Circuits are unique to LLClientView")] 774 // [Obsolete("LLClientView Specific - Circuits are unique to LLClientView")]
769 uint CircuitCode { get; } 775 uint CircuitCode { get; }
770 776
diff --git a/OpenSim/Framework/Monitoring/WorkManager.cs b/OpenSim/Framework/Monitoring/WorkManager.cs
index 5d9b185..c6d97e1 100644
--- a/OpenSim/Framework/Monitoring/WorkManager.cs
+++ b/OpenSim/Framework/Monitoring/WorkManager.cs
@@ -88,6 +88,11 @@ namespace OpenSim.Framework.Monitoring
88 Watchdog.Stop(); 88 Watchdog.Stop();
89 } 89 }
90 90
91 public static Thread StartThread(ThreadStart start, string name, bool alarmIfTimeout = false, bool log = true)
92 {
93 return StartThread(start, name, ThreadPriority.Normal, true, alarmIfTimeout, null, Watchdog.DEFAULT_WATCHDOG_TIMEOUT_MS, log);
94 }
95
91 /// <summary> 96 /// <summary>
92 /// Start a new long-lived thread. 97 /// Start a new long-lived thread.
93 /// </summary> 98 /// </summary>
@@ -99,9 +104,9 @@ namespace OpenSim.Framework.Monitoring
99 /// <param name="log">If true then creation of thread is logged.</param> 104 /// <param name="log">If true then creation of thread is logged.</param>
100 /// <returns>The newly created Thread object</returns> 105 /// <returns>The newly created Thread object</returns>
101 public static Thread StartThread( 106 public static Thread StartThread(
102 ThreadStart start, string name, ThreadPriority priority, bool isBackground, bool alarmIfTimeout, bool log = true) 107 ThreadStart start, string name, ThreadPriority priority, bool alarmIfTimeout, bool log = true)
103 { 108 {
104 return StartThread(start, name, priority, isBackground, alarmIfTimeout, null, Watchdog.DEFAULT_WATCHDOG_TIMEOUT_MS, log); 109 return StartThread(start, name, priority, true, alarmIfTimeout, null, Watchdog.DEFAULT_WATCHDOG_TIMEOUT_MS, log);
105 } 110 }
106 111
107 /// <summary> 112 /// <summary>
@@ -162,15 +167,22 @@ namespace OpenSim.Framework.Monitoring
162 { 167 {
163 Culture.SetCurrentCulture(); 168 Culture.SetCurrentCulture();
164 callback(obj); 169 callback(obj);
165 Watchdog.RemoveThread(log:false);
166 } 170 }
167 catch (Exception e) 171 catch (Exception e)
168 { 172 {
169 m_log.Error(string.Format("[WATCHDOG]: Exception in thread {0}.", name), e); 173 m_log.Error(string.Format("[WATCHDOG]: Exception in thread {0}.", name), e);
170 } 174 }
175 finally
176 {
177 try
178 {
179 Watchdog.RemoveThread(log: false);
180 }
181 catch { }
182 }
171 }); 183 });
172 184
173 StartThread(ts, name, ThreadPriority.Normal, true, false, log:log); 185 StartThread(ts, name, false, log:log);
174 } 186 }
175 187
176 /// <summary> 188 /// <summary>
@@ -187,54 +199,6 @@ namespace OpenSim.Framework.Monitoring
187 Util.FireAndForget(callback, obj, name, timeout); 199 Util.FireAndForget(callback, obj, name, timeout);
188 } 200 }
189 201
190 /// <summary>
191 /// Run a job.
192 /// </summary>
193 /// <remarks>
194 /// This differs from direct scheduling (e.g. Util.FireAndForget) in that a job can be run in the job
195 /// engine if it is running, where all jobs are currently performed in sequence on a single thread. This is
196 /// to prevent observed overload and server freeze problems when there are hundreds of connections which all attempt to
197 /// perform work at once (e.g. in conference situations). With lower numbers of connections, the small
198 /// delay in performing jobs in sequence rather than concurrently has not been notiecable in testing, though a future more
199 /// sophisticated implementation could perform jobs concurrently when the server is under low load.
200 ///
201 /// However, be advised that some callers of this function rely on all jobs being performed in sequence if any
202 /// jobs are performed in sequence (i.e. if jobengine is active or not). Therefore, expanding the jobengine
203 /// beyond a single thread will require considerable thought.
204 ///
205 /// Also, any jobs submitted must be guaranteed to complete within a reasonable timeframe (e.g. they cannot
206 /// incorporate a network delay with a long timeout). At the moment, work that could suffer such issues
207 /// should still be run directly with RunInThread(), Util.FireAndForget(), etc. This is another area where
208 /// the job engine could be improved and so CPU utilization improved by better management of concurrency within
209 /// OpenSimulator.
210 /// </remarks>
211 /// <param name="jobType">General classification for the job (e.g. "RezAttachments").</param>
212 /// <param name="callback">Callback for job.</param>
213 /// <param name="obj">Object to pass to callback when run</param>
214 /// <param name="name">Specific name of job (e.g. "RezAttachments for Joe Bloggs"</param>
215 /// <param name="canRunInThisThread">If set to true then the job may be run in ths calling thread.</param>
216 /// <param name="mustNotTimeout">If the true then the job must never timeout.</param>
217 /// <param name="log">If set to true then extra logging is performed.</param>
218 public static void RunJob(
219 string jobType, WaitCallback callback, object obj, string name,
220 bool canRunInThisThread = false, bool mustNotTimeout = false,
221 bool log = false)
222 {
223 if (Util.FireAndForgetMethod == FireAndForgetMethod.RegressionTest)
224 {
225 Culture.SetCurrentCulture();
226 callback(obj);
227 return;
228 }
229
230 if (JobEngine.IsRunning)
231 JobEngine.QueueJob(name, () => callback(obj));
232 else if (canRunInThisThread)
233 callback(obj);
234 else
235 Util.FireAndForget(callback, obj, name, !mustNotTimeout);
236 }
237
238 private static void HandleControlCommand(string module, string[] args) 202 private static void HandleControlCommand(string module, string[] args)
239 { 203 {
240 // if (SceneManager.Instance.CurrentScene != null && SceneManager.Instance.CurrentScene != m_udpServer.Scene) 204 // if (SceneManager.Instance.CurrentScene != null && SceneManager.Instance.CurrentScene != m_udpServer.Scene)