tune poll smartThreadpool use and give it a name

avinationmerge
UbitUmarov 2014-10-13 11:38:51 +01:00
parent 9a3df6445e
commit 8558e97a44
1 changed files with 5 additions and 2 deletions

View File

@ -57,24 +57,27 @@ namespace OpenSim.Framework.Servers.HttpServer
private bool m_running = true; private bool m_running = true;
private int slowCount = 0; private int slowCount = 0;
private SmartThreadPool m_threadPool = new SmartThreadPool(20000, 12, 2); private SmartThreadPool m_threadPool;
public PollServiceRequestManager(BaseHttpServer pSrv, uint pWorkerThreadCount, int pTimeout) public PollServiceRequestManager(BaseHttpServer pSrv, uint pWorkerThreadCount, int pTimeout)
{ {
m_server = pSrv; m_server = pSrv;
m_WorkerThreadCount = pWorkerThreadCount; m_WorkerThreadCount = pWorkerThreadCount;
m_workerThreads = new Thread[m_WorkerThreadCount]; m_workerThreads = new Thread[m_WorkerThreadCount];
m_threadPool = new SmartThreadPool(30000, 15, 1);
m_threadPool.Name = "PoolService";
} }
public void Start() public void Start()
{ {
m_threadPool.Start();
//startup worker threads //startup worker threads
for (uint i = 0; i < m_WorkerThreadCount; i++) for (uint i = 0; i < m_WorkerThreadCount; i++)
{ {
m_workerThreads[i] m_workerThreads[i]
= Watchdog.StartThread( = Watchdog.StartThread(
PoolWorkerJob, PoolWorkerJob,
string.Format("PollServiceWorkerThread{0}:{1}", i, m_server.Port), string.Format("PollServiceWorkerThread {0}:{1}", i, m_server.Port),
ThreadPriority.Normal, ThreadPriority.Normal,
false, false,
false, false,