Setting the priority lower for the listening thread won't solve your problem. All the listener thread is doing is listening, which is not a CPU-intensive task. Until a connection arrives, that thread isn't doing anything at all. You may be able to confirm that with a tool like Process Explorer; I think it can show CPU usage by thread.
Setting the priority lower may actually make your server appear less responsive because when a connection arrives, the thread listening for that connection will run with lower priority and won't be able to work on the connection immediately. The client will have to wait a little longer before your server starts processing its request.
The requests are not handled in the listener thread. The listener thread delegates most of the work to other threads. If you have just one TCP binding, then you'll have just one listener thread, but you can process many concurrent connections. Each connection will be handled by a separate thread despite there being only one listener.
Anyway, you can change the priority by handling the server object's OnBeforeListenerRun
event. It receives a reference to the TIdThread
that represents the listener thread, so you can assign a different value to its Priority
property. Also, you have the source code, so you could go in and change the definition of the tpListener
constant in IdGlobalCore.pas. The code uses that value, not tpHighest
directly.