Skip to content

Commit 38e7316

Browse files
authored
Merge pull request #160 from gftea/patch-1
Update 02_handling_connections_concurrently.md
2 parents 3c84923 + 13a9309 commit 38e7316

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/09_example/02_handling_connections_concurrently.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ As long as `handle_connection` does not block, a slow request will no longer pre
3939
{{#include ../../examples/09_04_concurrent_tcp_server/src/main.rs:main_func}}
4040
```
4141
# Serving Requests in Parallel
42-
Our example so far has largely presented concurrency (using async code)
43-
as an alternative to parallelism (using threads).
42+
Our example so far has largely presented cooperative multitasking concurrency (using async code)
43+
as an alternative to preemptive multitasking (using threads).
4444
However, async code and threads are not mutually exclusive.
4545
In our example, `for_each_concurrent` processes each connection concurrently, but on the same thread.
4646
The `async-std` crate allows us to spawn tasks onto separate threads as well.
@@ -49,6 +49,6 @@ Here's what that would look like:
4949
```rust
5050
{{#include ../../examples/09_05_final_tcp_server/src/main.rs:main_func}}
5151
```
52-
Now we are using both concurrency and parallelism to handle multiple requests at the same time!
52+
Now we are using both cooperative multitasking concurrency and preemptive multitasking to handle multiple requests at the same time!
5353
See the [section on multithreaded executors](../08_ecosystem/00_chapter.md#single-threading-vs-multithreading)
54-
for more information.
54+
for more information.

0 commit comments

Comments
 (0)