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

Document SWIFT_UNEXPECTED_EXECUTOR_LOG_LEVEL environment variable #136

Open
dehesa opened this issue Aug 16, 2024 · 0 comments
Open

Document SWIFT_UNEXPECTED_EXECUTOR_LOG_LEVEL environment variable #136

dehesa opened this issue Aug 16, 2024 · 0 comments

Comments

@dehesa
Copy link

dehesa commented Aug 16, 2024

Swift 5.10 permit the creation of actors with custom executors. A very common use case is actors backed with a DispatchQueue. This is useful when wrapping lower-level APIs, such as FSEventStreams or any queue-backed Core Foundation functionality. For those case, you can define an actor wrapping the state and be sure to be called back in the executor queue.

Swift 6 introduces the assumeIsolated(_:) function that permits to jump synchronously to the actor's critical section; However that functionality is not backported and therefore you need to use "unsafe bitcasting" for systems running in Swift 5 runtimes. The bitcasting sadly produces a warning every time the bitcast is used. For cases such a File System monitor that will produce an exorbitant amount of warnings. The only way to remove those warnings is setting SWIFT_UNEXPECTED_EXECUTOR_LOG_LEVEL=0.

We have discussed this in the Swift forums.

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

No branches or pull requests

1 participant