Skip to content
This repository has been archived by the owner on Jun 6, 2024. It is now read-only.

Global lock on active page = BAD, Make it a channel instead #20

Open
SarveshOO7 opened this issue Apr 20, 2024 · 0 comments
Open

Global lock on active page = BAD, Make it a channel instead #20

SarveshOO7 opened this issue Apr 20, 2024 · 0 comments

Comments

@SarveshOO7
Copy link
Collaborator

Make the evictor thread just receive from a channel details about each page that is loaded when it is loaded. This way the active pages would not require a large lock like on this line

async-bpm/src/page/page_handle.rs

Line 177 in f66b7d8

let mut active_guard = self.bpm.active_pages.lock().await;
So instead, it can just be a push to a channel and there will be no contention on a global lock for the active_pages hash map because there will be no hash map.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant