diff --git a/Main/ghttp.cpp b/Main/ghttp.cpp index c95e565..cabe138 100644 --- a/Main/ghttp.cpp +++ b/Main/ghttp.cpp @@ -145,6 +145,8 @@ int main(int argc, char *argv[]) srand(time(NULL)); while (true) { + //NOTICE: here we use 2 processes, father process is used for monitor and control(like, restart) + //Child process is used to deal with web requests, can also has many threads pid_t fpid = fork(); if (fpid == 0) { @@ -435,6 +437,8 @@ bool stop_thread(pthread_t _thread) { return pthread_kill(_thread, SIGTERM) == 0; } +//DEBUG+TODO: the whole process exits and need to reload the database +//(too slow: quit and restart) void* func_timer(void* _args) { signal(SIGTERM, thread_sigterm_handler); sleep(Util::gserver_query_timeout);