multi-process model: Improve

Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
This commit is contained in:
Jianhui Zhao committed 2021-01-03 18:15:06 +08:00
1 parent c11052e302
commit d6868b6ab3
3 files changed
+8 -2

No files matched your search

+1
View File
@@ -159,6 +159,7 @@ static void uh_start_worker(struct uh_server *srv, int n)
case 0:
ev_loop_fork(srvi->loop);
uh_start_accept(srvi);
ev_run(srvi->loop, 0);
return;
}
}
+1
View File
@@ -81,6 +81,7 @@ struct uh_server {
void (*free)(struct uh_server *srv);
/*
** Start n worker processes to process the requests
** Must be called after the Server has been initialized
** If n is -1, automatically to available CPUs
*/
void (*start_worker)(struct uh_server *srv, int n);