Improved server thread management