Skip to content

[concurrency] Diagnose synchronous sendable actor isolated functions that have their actor isolation type erased. #72605

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

Conversation

gottesmm
Copy link
Contributor

The problem that we are running into here is that:

  1. actor isolated functions are considered sendable... so we cannot use region based isolation here.

  2. But, structurally a synchronous actor isolated function can only be called from a context where we know that it is actor isolated so the caller can hop to the correct executor. Once the value is type erased and passed to a caller, we no longer have that information potentially creating races.

Since I can't use region isolation here, I created a type checker check instead.

rdar://118206647

…that have their actor isolation type erased.

The problem that we are running into here is that:

1. actor isolated functions are considered sendable... so we cannot use region
based isolation here.

2. But, structurally a synchronous actor isolated function can only be called
from a context where we know that it is actor isolated so the caller can hop to
the correct executor. Once the value is type erased and passed to a caller, we
no longer have that information potentially creating races.

Since I can't use region isolation here, I created a type checker check instead.

rdar://118206647
@gottesmm
Copy link
Contributor Author

@swift-ci smoke test

@hborla
Copy link
Member

hborla commented Mar 28, 2024

I believe this is subsumed by #72607 unless we want to repurpose this PR for the region isolation issue mentioned in that PR description

@gottesmm
Copy link
Contributor Author

No. I am just going to close this.

@gottesmm gottesmm closed this Mar 29, 2024
@gottesmm gottesmm deleted the pr-3e88fdbd39a3daf63bdb8b7bbcc1f1153dd9e29c branch March 29, 2024 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants