You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The last sentence of the first para of the section about Sendable Types is (to me, an uninformed reader) confusingly written and could be ideally be clearer.
The text currently reads:
Some kinds of data can’t be shared between concurrency domains, because that data contains mutable state, but it doesn’t protect against overlapping access.
Perhaps it's just me, but that sentence is confusing. The first part is a negative statement (data cannot be shared) then there's a 'but', so I'm expecting an opposing clause, but instead there's another negative clause (doesn't protect.)
The 'but' is confusing. Should I be expecting the non-sharability to protect 'overlapping access'? (not sure what that term means either.)
Maybe I'm being dim, but I come out of reading that sentence with more questions...
Correction
I'm not sure what the docs should say here. Please clarify why these two concepts are related, and what 'overlapping access' means. Thanks!
The text was updated successfully, but these errors were encountered:
amartini51
changed the title
Concurrency Domains - unclear / confusing sentence
Concurrency > Sendable Types — Clarify intro about non-sendable data
Mar 12, 2024
This sentence should avoid the phrase "overlapping access" — the meaning here isn't exactly the same as how Memory Safety later uses it. Here we mean access from different parts of the program that are running concurrently.
So, would the following version of the sentence be more suitable?
Some kinds of data can’t be shared between concurrency domains, because that data contains mutable state, and is not protected against concurrent access.
I'm looking at the paragraph, and I wonder if we need this sentence at all. I think I wrote it to introduce the problem before showing the solution, but maybe it better for me to rewrite and remove this.
A paragraph later, we say essentially the same thing:
In contrast, some types aren’t safe to pass across concurrency domains.
Location
https://docs.swift.org/swift-book/documentation/the-swift-programming-language/concurrency/#Sendable-Types
Description
The last sentence of the first para of the section about Sendable Types is (to me, an uninformed reader) confusingly written and could be ideally be clearer.
The text currently reads:
Perhaps it's just me, but that sentence is confusing. The first part is a negative statement (data cannot be shared) then there's a 'but', so I'm expecting an opposing clause, but instead there's another negative clause (doesn't protect.)
The 'but' is confusing. Should I be expecting the non-sharability to protect 'overlapping access'? (not sure what that term means either.)
Maybe I'm being dim, but I come out of reading that sentence with more questions...
Correction
I'm not sure what the docs should say here. Please clarify why these two concepts are related, and what 'overlapping access' means. Thanks!
The text was updated successfully, but these errors were encountered: