thread_server implement