Multithreaded server recommendations

When you write a typical server to take advantage of threads, a common design is to have a single listener thread waiting for client requests and multiple individual worker threads to perform the client's requested operations.

Creating threads should not use very many resources. However, because some servers require a faster response time to clients, some server application programs maintain a pool of worker threads that are waiting for work. They do this to avoid creating new threads.

Typically, the worker threads use some synchronization primitive to wait for client processing requests. Instead of creating a new thread to process each client request, the listener thread queues the client request and signals the waiting worker threads. The signal sometimes uses variables.

A server application is commonly considered trusted with the data that it serves to clients. Because the server is running multithreaded applications, you must consider some issues concerning the activities it performs: