Skip to content
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

Suggestion about the description that "A type that conforms to the Sendable protocol is a thread-safe type" #2482

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

stzn
Copy link
Contributor

@stzn stzn commented Jun 12, 2024

A type that conforms to the Sendable protocol is a thread-safe type

When we talked about the above description, we thought that it's not correct since the type which conforms to Sendable is not always thread-safe.

For example, if a non-Sendable class which has a Sendable struct(e.g. Array<Int>) is accessed from multiple concurrent contexts at once and the class calls the struct's mutating func, data races could be caused.

We think that Swift just has a system to avoid data races rather than guaranteeing thread safety for types and it's better to change the description.

We are proposing an amendment. Please check it.
Thank you.

Discussion thread: https://forums.swift.org/t/a-type-that-conforms-to-sendable-type-is-a-thread-safe-type/72381

@rjmccall rjmccall added content change Content change to an existing document LSG Contains topics under the domain of the Language Steering Group labels Jul 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
content change Content change to an existing document LSG Contains topics under the domain of the Language Steering Group
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants