-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ch. 17: pull disconnected material out of 17.01
- Loading branch information
1 parent
d61b736
commit b86ccd0
Showing
2 changed files
with
22 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<!-- TODO: find the right home for this (maybe nowhere!) --> | ||
|
||
As we saw in the previous chapter, threads provide one approach to concurrency, | ||
and they let us solve some of these issues. However, they also have some | ||
tradeoffs. On many operating systems, they use a fair bit of memory for each | ||
thread, and they come with some overhead for starting up and shutting down. | ||
Threads are also only an option when your operating system and hardware support | ||
them! While mainstream desktop and mobile operating systems have all had | ||
threading for many years, many embedded operating systems, like those used on | ||
some microcontrollers, do not. | ||
|
||
The async model provides a different—and ultimately complementary—set of | ||
tradeoffs. In the async model, concurrent operations do not require their own | ||
threads. Instead, they can run on *tasks*. A task is a bit like a thread, but | ||
instead of being managed by the operating system, it is managed by code that | ||
lives at the level of libraries. |