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

Native: assume New Memory Manager #4287

Merged
merged 32 commits into from
Aug 1, 2022
Merged

Native: assume New Memory Manager #4287

merged 32 commits into from
Aug 1, 2022

Conversation

BoD
Copy link
Contributor

@BoD BoD commented Jul 22, 2022

Assume running under the New Memory Manager (aka New Memory Model).

Related to #4100

  • Replace custom dispatcher implementations using the main thread on Apple, with newFixedThreadPoolContext / newSingleThreadContext
  • Remove custom code to dispatch callbacks on main thread and checks to be called from the main thread
  • Use a Mutex instead of a single thread queue in Guard
  • Remove all calls to freeze and related
  • Also mark runTest as deprecated

@netlify
Copy link

netlify bot commented Jul 22, 2022

Deploy Preview for apollo-android-docs canceled.

Name Link
🔨 Latest commit 867522f
🔍 Latest deploy log https://app.netlify.com/sites/apollo-android-docs/deploys/62e7ee2eff09e90008d7a0b2

Copy link
Contributor

@martinbonnin martinbonnin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very cool 🚀 . That's a very welcome change! I think we can even simplify a bit more. Let me know what you think!

@BoD BoD marked this pull request as draft July 26, 2022 19:22
@BoD BoD marked this pull request as ready for review July 26, 2022 19:23
@BoD BoD requested a review from martinbonnin July 26, 2022 19:23
Copy link
Contributor

@martinbonnin martinbonnin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comments above

Copy link
Contributor

@martinbonnin martinbonnin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏

@martinbonnin
Copy link
Contributor

Something that just came to mind, we'll need to update https://github.com/apollographql/apollo-kotlin/blob/f890e3408d61acaa60aa5f6f2a3da93256bdf1ce/design-docs/Threading.md. Let me know if you want to do it. Or I can too.

@BoD
Copy link
Contributor Author

BoD commented Jul 28, 2022

@martinbonnin I've just applied minor tweaks to Threading.md to remove / update obviously no longer correct or relevant bits. but it may benefit from a bigger revamp :) Don't hesitate to make more changes if you feel inspired!

BoD added 3 commits August 1, 2022 17:10
…t for background dispatchers

- Remove suspendAndResumeOnMain, replaced with suspendCancellableCoroutine
- Remove assertMainThreadOnNative
BoD and others added 24 commits August 1, 2022 17:10
…freeze, isFrozen, as no-ops to avoid a breaking change
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