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

Use parking_lot #82

Closed
wants to merge 3 commits into from
Closed

Use parking_lot #82

wants to merge 3 commits into from

Conversation

AMythicDev
Copy link
Owner

This PR introduces parking_lot sync primitives to replace Rust's std types for faster and much smaller sync types.

This also fixes a bug where calling dynamic_paging or static_paging again after the first pager would cause a panic.

parking_lot provides much faster and smaller primitives than Rust's std.
During thread panic, these locks do not get poisoned and hence we can
remove all the explicit care that we had to put to handle poisoning.
Also once_cell can also leverage parking_lot's types for smaller Lazy
types.

This PR moves all the usage of std'd Mutex and other sync types to
parking_lot's equivalent types.

This PR also fixes a bug where calling `dynamic_paging` or
`static_paging` will cause a panic since the value of OnceCell is
already set and we cannot mutate it without using unsafe
We also used AtomicBool where it would have been a better choice than
a parking_lot type
@AMythicDev AMythicDev added I-api Internal API change M-deps Dependecies labels Sep 26, 2022
@AMythicDev AMythicDev self-assigned this Sep 26, 2022
@AMythicDev AMythicDev added the A: perf Performance improvements label Sep 28, 2022
@AMythicDev AMythicDev changed the title Use parking lot Use parking_lot Sep 28, 2022
@AMythicDev
Copy link
Owner Author

Merged locally

@AMythicDev AMythicDev closed this Oct 16, 2022
@AMythicDev AMythicDev deleted the use-parking_lot branch April 8, 2023 19:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A: perf Performance improvements I-api Internal API change M-deps Dependecies
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

1 participant