Skip to content

Commit ceb78f3

Browse files
authoredFeb 27, 2025··
Merge pull request #242 from lonesometraveler/fix_typo
Fix typo in more-async-await.md
2 parents f2fa3fb + a2f7933 commit ceb78f3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎src/part-guide/more-async-await.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ An example of how this can go wrong is if an async function reads data into an i
6767

6868
We'll be coming back to cancellation and cancellation safety a few times in this guide, and there is a whole [chapter]() on the topic in the reference section.
6969

70-
[^cfThreads]: It is interesting to compare cancellation in async programming with canceling threads. Canceling a thread is possible (e.g., using `pthread_cancel` in C, there is no direct way to do this in Rust), but it is almost always a very, very bad idea since the thread being canceled can terminate anywhere. in contrast, canceling an async task can only happen at an await point. As a consequence, it is very rare to cancel an OS thread without terminating the whole porcess and so as a programmer, you generally don't worry about this happening. In async Rust however, cancellation is definitely something which *can* happen. We'll be discussing how to deal with that as we go along.
70+
[^cfThreads]: It is interesting to compare cancellation in async programming with canceling threads. Canceling a thread is possible (e.g., using `pthread_cancel` in C, there is no direct way to do this in Rust), but it is almost always a very, very bad idea since the thread being canceled can terminate anywhere. In contrast, canceling an async task can only happen at an await point. As a consequence, it is very rare to cancel an OS thread without terminating the whole process and so as a programmer, you generally don't worry about this happening. In async Rust however, cancellation is definitely something which *can* happen. We'll be discussing how to deal with that as we go along.
7171

7272
## Async blocks
7373

0 commit comments

Comments
 (0)
Please sign in to comment.