aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Util.cs
diff options
context:
space:
mode:
authorMelanie2009-10-27 20:28:12 +0000
committerMelanie2009-10-27 20:28:12 +0000
commit0d37883bfdb1c8e15187f63f170765c7909a6650 (patch)
tree25a5d722292d038d1ca314199b29efed54aed426 /OpenSim/Framework/Util.cs
parentMerge branch 'master' into vehicles (diff)
parentRemove the rest of SECS. It was never used, except by an experimental version (diff)
downloadopensim-SC-0d37883bfdb1c8e15187f63f170765c7909a6650.zip
opensim-SC-0d37883bfdb1c8e15187f63f170765c7909a6650.tar.gz
opensim-SC-0d37883bfdb1c8e15187f63f170765c7909a6650.tar.bz2
opensim-SC-0d37883bfdb1c8e15187f63f170765c7909a6650.tar.xz
Merge branch 'master' into vehicles
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/Util.cs21
1 files changed, 21 insertions, 0 deletions
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs
index 10f38ab..87ba5a8 100644
--- a/OpenSim/Framework/Util.cs
+++ b/OpenSim/Framework/Util.cs
@@ -1330,6 +1330,27 @@ namespace OpenSim.Framework
1330 m_ThreadPool = new SmartThreadPool(2000, maxThreads, 2); 1330 m_ThreadPool = new SmartThreadPool(2000, maxThreads, 2);
1331 } 1331 }
1332 1332
1333 public static int FireAndForgetCount()
1334 {
1335 const int MAX_SYSTEM_THREADS = 200;
1336
1337 switch (FireAndForgetMethod)
1338 {
1339 case FireAndForgetMethod.UnsafeQueueUserWorkItem:
1340 case FireAndForgetMethod.QueueUserWorkItem:
1341 case FireAndForgetMethod.BeginInvoke:
1342 int workerThreads, iocpThreads;
1343 ThreadPool.GetAvailableThreads(out workerThreads, out iocpThreads);
1344 return workerThreads;
1345 case FireAndForgetMethod.SmartThreadPool:
1346 return m_ThreadPool.MaxThreads - m_ThreadPool.InUseThreads;
1347 case FireAndForgetMethod.Thread:
1348 return MAX_SYSTEM_THREADS - System.Diagnostics.Process.GetCurrentProcess().Threads.Count;
1349 default:
1350 throw new NotImplementedException();
1351 }
1352 }
1353
1333 public static void FireAndForget(System.Threading.WaitCallback callback, object obj) 1354 public static void FireAndForget(System.Threading.WaitCallback callback, object obj)
1334 { 1355 {
1335 switch (FireAndForgetMethod) 1356 switch (FireAndForgetMethod)