Add multithreading
This commit is contained in:
parent
0ce315368a
commit
cb2f97a28f
1 changed files with 4 additions and 0 deletions
|
@ -104,5 +104,9 @@ pub fn main() !void {
|
||||||
defer srv.deinit();
|
defer srv.deinit();
|
||||||
try srv.listen(std.net.Address.parseIp("0.0.0.0", 8080) catch unreachable);
|
try srv.listen(std.net.Address.parseIp("0.0.0.0", 8080) catch unreachable);
|
||||||
|
|
||||||
|
var i: usize = 0;
|
||||||
|
while (i < cfg.worker_threads - 1) : (i += 1) {
|
||||||
|
_ = try std.Thread.spawn(.{}, thread_main, .{ &api_src, &srv });
|
||||||
|
}
|
||||||
thread_main(&api_src, &srv);
|
thread_main(&api_src, &srv);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue