mirror of
https://github.com/gnu4cn/rust-lang-zh_CN.git
synced 2025-03-14 19:30:29 +08:00
Update Ch20
This commit is contained in:
parent
b485dcaf98
commit
1293bf7e8c
@ -476,3 +476,5 @@ fn handle_conn(mut stream: TcpStream) {
|
||||
## 将咱们的单线程服务器改写为多线程服务器
|
||||
|
||||
**Turning Our Single-Thread Server into a Multithreaded Server**
|
||||
|
||||
现在,这个服务器将依次处理每个请求,这意味着其将不会在前一个连接完成处理前,处理后一连接。若服务器收到了越来越多的请求,这种顺序执行就会越来越差。而若该服务器收到了一个要耗费较长时间处理的请求,即使后续的新请求可被快速处理,但其仍将不得不等待直到那个长时间请求完成。咱们需要修复这个问题,但首选,咱们将具体看看这个问题。
|
||||
|
Loading…
Reference in New Issue
Block a user