Thread server implementation