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
Sadly sendable Generator is currently unsound because thread local variables may leak non-sendable values from within the our coroutine. Here's example:
This is a long known issue. This is why may spawn is unsafe. You should use coroutine_local! here. And I have no better idea to design the API, do you have any suggestions?
zetanumbers
changed the title
Sendable Generator is unsound
Safe sendable Generator is unsound
Jun 17, 2024
Uh oh!
There was an error while loading. Please reload this page.
Sadly sendable
Generator
is currently unsound because thread local variables may leak non-sendable values from within the our coroutine. Here's example:Output:
See https://blaz.is/blog/post/lets-pretend-that-task-equals-thread/ and https://users.rust-lang.org/t/controversial-opinion-keeping-rc-across-await-should-not-make-future-send-by-itself/100554/12 for details.
The text was updated successfully, but these errors were encountered: