Thread pool implementation for the Socket server