Alvaro Cabrerizo wrote:
We can see that all of the handlers (I launch the server using 5 handlers)
are waiting for new queued calls, we can watch it in the next piece of
code
from the run method that belongs to class Handler:
while (running && callQueue.size()==0) { // wait for a call
callQueue.wait(timeout); //line 471
}
In the other hand the Listener is waiting because it thinks queue is full.
This is shown in the next piece of code from the processData method that
belongs to class Connection:
while (running && callQueue.size() >= maxQueuedCalls) {
synchronized (callDequeued) { // queue is full1
callDequeued.wait(timeout); // wait for a dequeue for 60
seconds (line 433)
}
}
So Listener thinks queue is full and Handlers that it is empty, somebody
must be wrong.
In trunk Server.java has since changed significantly, now using async
i/o. The callDequeued object is no longer used. So I'm not sure that
your concerns are still relevant. (Nor am I certain they are not, but
at least they need to be re-evaluated for the current code.)
Doug