Skip to content

Add RwSpinLock#8

Merged
mkroening merged 1 commit into
mainfrom
rwlock
Feb 8, 2023
Merged

Add RwSpinLock#8
mkroening merged 1 commit into
mainfrom
rwlock

Conversation

@mkroening
Copy link
Copy Markdown
Member

Closes #6.

@mkroening
Copy link
Copy Markdown
Member Author

CC: @stlankes, @jounathaen

@stlankes
Copy link
Copy Markdown

Do we need an upgradable RW lock? Why do you prefer this version?

@mkroening
Copy link
Copy Markdown
Member Author

This lock is very small (1 usize) and very simple (stupid spinning on flags + backoff). I adapted it from spin::rwlock::RwLock.

We'll have to do benchmarks, but for scenarios with little contention I'd expect the more complex PFLock not to be necessary.

Upgradability and reentrancy come for free with this design. It's not something that we require at the moment, though.

@stlankes
Copy link
Copy Markdown

Ah, I oversaw also your PR cmnord/pflock#9

@mkroening mkroening marked this pull request as ready for review February 8, 2023 11:20
@mkroening mkroening merged commit 3338a62 into main Feb 8, 2023
@mkroening mkroening deleted the rwlock branch February 8, 2023 11:27
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.

Add RwLock

2 participants