This is a completely unreasonable thing to do, effectively defying the purpose of BlockingQueues. Trying this, to see the effect on CPU.
parent
5f95f4d78e
commit
5232ab0496
|
@ -46,7 +46,7 @@ namespace OpenSim.Framework.Servers.HttpServer
|
|||
|
||||
private readonly BaseHttpServer m_server;
|
||||
|
||||
private DoubleQueue<PollServiceHttpRequest> m_requests = new DoubleQueue<PollServiceHttpRequest>();
|
||||
private BlockingQueue<PollServiceHttpRequest> m_requests = new BlockingQueue<PollServiceHttpRequest>();
|
||||
private static Queue<PollServiceHttpRequest> m_longPollRequests = new Queue<PollServiceHttpRequest>();
|
||||
|
||||
private uint m_WorkerThreadCount = 0;
|
||||
|
@ -163,7 +163,7 @@ namespace OpenSim.Framework.Servers.HttpServer
|
|||
m_requests.Enqueue(m_longPollRequests.Dequeue());
|
||||
}
|
||||
|
||||
while (m_requests.Count > 0)
|
||||
while (m_requests.Count() > 0)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -185,10 +185,21 @@ namespace OpenSim.Framework.Servers.HttpServer
|
|||
{
|
||||
while (m_running)
|
||||
{
|
||||
PollServiceHttpRequest req = m_requests.Dequeue(5000);
|
||||
Watchdog.UpdateThread();
|
||||
|
||||
PollServiceHttpRequest req = null;
|
||||
lock (m_requests)
|
||||
{
|
||||
if (m_requests.Count() > 0)
|
||||
req = m_requests.Dequeue();
|
||||
}
|
||||
if (req == null)
|
||||
Thread.Sleep(100);
|
||||
else
|
||||
{
|
||||
//PollServiceHttpRequest req = m_requests.Dequeue(5000);
|
||||
//m_log.WarnFormat("[YYY]: Dequeued {0}", (req == null ? "null" : req.PollServiceArgs.Type.ToString()));
|
||||
|
||||
Watchdog.UpdateThread();
|
||||
if (req != null)
|
||||
{
|
||||
try
|
||||
|
@ -249,4 +260,5 @@ namespace OpenSim.Framework.Servers.HttpServer
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue