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

core: fine-grained application state locking #425

Merged
merged 1 commit into from
Dec 28, 2020

Conversation

tony-iqlusion
Copy link
Member

Removes the RwLock on application state (previously located in AppCell), replacing it with a fine-grained locking strategy:

  • Makes the Application type immutable with various interior mutability strategies
  • Uses arc-swap to handle updatable Config storage, as mediated through a new CfgCell wrapper
  • Makes the application::State struct opaque with RwLock access to inner fields mediated by method-based accessors
  • Adds type aliases for state accessors to make changing the strategy simpler in the future

Removes the `RwLock` on application state (previously located in
`AppCell`), replacing it with a fine-grained locking strategy:

- Makes the `Application` type immutable with various interior
  mutability strategies
- Uses `arc-swap` to handle updatable `Config` storage, as mediated
  through a new `CfgCell` wrapper
- Makes the `application::State` struct opaque with `RwLock` access to
  inner fields mediated by method-based accessors
- Adds type aliases for state accessors to make changing the strategy
  simpler in the future
@tarcieri tarcieri force-pushed the core/fine-grained-application-state-locking branch from a070d70 to a7bf6db Compare December 28, 2020 00:45
@tony-iqlusion tony-iqlusion merged commit 63a60b3 into main Dec 28, 2020
@tony-iqlusion tony-iqlusion deleted the core/fine-grained-application-state-locking branch December 28, 2020 01:02
@tony-iqlusion tony-iqlusion mentioned this pull request Feb 11, 2022
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.

None yet

1 participant