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

Make update functions immutable #400

Open
jbearer opened this issue Feb 8, 2024 · 0 comments
Open

Make update functions immutable #400

jbearer opened this issue Feb 8, 2024 · 0 comments

Comments

@jbearer
Copy link
Member

jbearer commented Feb 8, 2024

Postgres goes out of its way to support both concurrent readers and writers, but we are not taking advantage of this because UpdateAvailabilityData::{insert_leaf, insert_block} take &mut self, which means they require mutable access to the data source and cannot be called concurrently with each other or any immutable queries.

We can likely get better parallelism for request handlers if we allow the insert functions to take &self, so they can run concurrently with immutable queries. For data sources that don't support this kind of concurrency, like the file system, we can just use an RwLock internally.

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

No branches or pull requests

1 participant