Skip to content

Commit

Permalink
Merge pull request #754 from LukerSpringtree/patch-1
Browse files Browse the repository at this point in the history
Update ch20-02-multithreaded.md 修改错别字
  • Loading branch information
KaiserY authored Dec 17, 2023
2 parents 58f9468 + b072b81 commit a72ec98
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ch20-02-multithreaded.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

现在就可以真切的看出我们的 server 有多么的原始:真实的库将会以更简洁的方式处理多请求识别问题!

使用 `cargo run` 启动 server,并接着打开两个浏览器窗口:一个请求 *http://127.0.0.1:7878/* 而另一个请求 *http://127.0.0.1:7878/sleep* 。如果像之前一样多次请求 */*,会发现响应的比较快速。不过如果请求 */sleep* 之后在请求 */*,就会看到 */* 会等待直到 `sleep` 休眠完五秒之后才出现。
使用 `cargo run` 启动 server,并接着打开两个浏览器窗口:一个请求 *http://127.0.0.1:7878/* 而另一个请求 *http://127.0.0.1:7878/sleep* 。如果像之前一样多次请求 */*,会发现响应的比较快速。不过如果请求 */sleep* 之后再请求 */*,就会看到 */* 会等待直到 `sleep` 休眠完五秒之后才出现。


有多种技术可以用来避免所有请求都排在慢请求之后;我们将要实现的一个便是线程池。
Expand Down

0 comments on commit a72ec98

Please sign in to comment.