[go: nahoru, domu]

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

ObjC interop guide needs to mention callbacks and threading limitations #4191

Closed
liamappelbe opened this issue Aug 25, 2022 · 0 comments · Fixed by #4194
Closed

ObjC interop guide needs to mention callbacks and threading limitations #4191

liamappelbe opened this issue Aug 25, 2022 · 0 comments · Fixed by #4194
Assignees
Labels
a.tut.tutorial Relates to the Tutorial section of dart.dev dev.ffi Relates to foreign function interface to integrate native code with Dart e1-hours Can complete in < 8 hours of normal, not dedicated, work p2-medium Necessary but not urgent concern. Resolve when possible.

Comments

@liamappelbe
Copy link
Contributor

Page URL

https://dart.dev/guides/libraries/objective-c-interop

Page source

No response

Describe the problem

There are 3 callback/threading issues with the current Objective-C interop:

  1. Dart can't pin an isolate to a thread at the moment (Feature request: API to allow setting thread pinning for Isolates sdk#46943)
  2. Most of the Apple APIs don't guarantee which thread a callback will be run on
  3. Many Apple APIs (eg any interacting with UI) can only be called from the main thread

Users need to keep these in mind when writing interop code that deals with callbacks, async APIs, or UI APIs.

Expected fix

Mention these limitations in the documentation.

Additional context

No response

@liamappelbe liamappelbe self-assigned this Aug 25, 2022
@parlough parlough added p2-medium Necessary but not urgent concern. Resolve when possible. a.tut.tutorial Relates to the Tutorial section of dart.dev e1-hours Can complete in < 8 hours of normal, not dedicated, work dev.ffi Relates to foreign function interface to integrate native code with Dart labels Aug 25, 2022
parlough added a commit that referenced this issue Aug 30, 2022
Fixes #4191

Co-authored-by: Shams Zakhour (ignore Sfshaza) <44418985+sfshaza2@users.noreply.github.com>
Co-authored-by: Parker Lougheed <parlough@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a.tut.tutorial Relates to the Tutorial section of dart.dev dev.ffi Relates to foreign function interface to integrate native code with Dart e1-hours Can complete in < 8 hours of normal, not dedicated, work p2-medium Necessary but not urgent concern. Resolve when possible.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants