-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Make Dart_Post
schedule on port's isolate
#49524
Comments
|
Thanks, |
fixes #49524 TEST=n/a, documentation Change-Id: Ia5154e9c2c1d6f6cce46e9bceb49f315cb840bc3 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/252681 Reviewed-by: Ryan Macnak <rmacnak@google.com> Commit-Queue: Ryan Macnak <rmacnak@google.com>
Ports do store the isolate which will process messages sent to the port. Though only as long as the isolate is alive, after it's death, posting messages to the port will be silently dropped. So the reference from Port to Isolate is in some sense a weak reference (and stored in our
To persist references to objects that the receiver can use (e.g. |
This tracker is for issues related to:
There doesn't appear to be a way to post data from C onto an arbitrary isolate. What I'd like to do is:
I don't believe this is possible with today's API since
Dart_Post
requires thatDart_CurrentIsolate() != nullptr
and one cannot safely callDart_EnterIsolate
safely from an arbitrary thread since it is an error to do so if another thread has already "entered" that isolate.This could be implemented by making ports store their isolate so that
Dart_Post
can schedule with that isolate, thus removing the dependency onDart_CurrentIsolate()
's value.This is a required feature if we ever want to implement flutter/flutter#13937 since this would allow scheduling on an arbitrary isolate's event loop via the SendPort API.
cc @mkustermann
The text was updated successfully, but these errors were encountered: