-
Notifications
You must be signed in to change notification settings - Fork 152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expand the concurrency chapter #159
Conversation
In the case of thumbnails, it would be better to make separate tasks for each job so they can run in parallel and Swift can schedule them for you, which makes it a weaker example.
The discussion already doesn't promise that the work will happen in parallel, only that it can happen in parallel.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor comments and ideas, hope this helps!
Co-authored-by: Evan Wilde <ewilde@apple.com> Co-authored-by: Konrad Malawski <konrad_malawski@apple.com>
Co-authored-by: Konrad Malawski <konrad_malawski@apple.com>
Incorporates feedback from Evan Wilde <ewilde@apple.com> and Konrad Malawski <konrad_malawski@apple.com>.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me
The framing of "no suspension points means no other code runs" is at best misleading outside of an actor, because there can be other code running concurrently. Inside of an actor, this kind of no-await code is a useful best practice that we want to show.
5a281f8
to
51e6d63
Compare
The previous paragraph talks about a single function that is both async and throwing -- but this paragraph describes some similarities between the two different kinds of functions, not about functions that are both.
Parallel and async code, by itself, doesn't give you memory safety. That's one of the reasons to use Swift concurrency -- to get memory safety in your code. Expand the "you can't do this" to give some follow-on advice about what you can do, in terms of adoption. Avoid the wording "even stronger" when there isn't an obvious guarantee being compared to.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please see edits and comments throughout. Please let me know if you have any questions or would like to discuss anything.
Edits from <rdar://117556772> Co-authored-by: Chuck Toporek <chuck_toporek@apple.com>
This has been looking quite good for a while, do we intend to merge soon @amartini51 or keep adding @amartini51 ? |
@ktoso I've got a few minor changes to make from Chuck's editorial review (likely this afternoon or tomorrow morning) then this will be ready to merge. |
Co-authored-by: Chuck Toporek <chuck_toporek@apple.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved.
Looks good I think! Thanks Alex et al |
Fixes: rdar://75895184