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

Replace the half-lock with helping strategy #50

Merged
merged 19 commits into from
Jan 3, 2021
Merged

Replace the half-lock with helping strategy #50

merged 19 commits into from
Jan 3, 2021

Conversation

vorner
Copy link
Owner

@vorner vorner commented Jan 3, 2021

This makes all the write operations lock-free too.

Also, as the helping strategy is based on that article in #34, that one probably can be closed too. And currently we also have some almost formal arguments about why things are correct.

Closes #8, #34 and #4.

Because we want it aligned.
And early, guarding from a „wrong“ pointer from getting in.
And preparing for merging with the debts for the helping strategy.
The helping strategy now shares the nodes (not the slots).
The default is now Hybrid<Helping>, which has overall better properties.
More refactoring needed.
The file is still left there with the documentation; documentation,
comments and such still need to get ported.
According to benchmarks, it's doing a better job of it anyway.
We are allowed to do it in two operations and it's faster that way.
The pointer is passed through an indirection "box" thing and these are
forced to be aligned.
Emulating them being full by a fake strategy.

Fixing releasing stuff.
Seems like minor perf improvements
Going over all the new synchronization and trying to prove it is
correct.
So we can see the values more easily.
@codecov-io
Copy link

codecov-io commented Jan 3, 2021

Codecov Report

Merging #50 (de104f8) into master (fbe2eee) will increase coverage by 0.91%.
The diff coverage is 90.69%.

@@            Coverage Diff             @@
##           master      #50      +/-   ##
==========================================
+ Coverage   89.02%   89.93%   +0.91%     
==========================================
  Files          15       15              
  Lines        1157      984     -173     
==========================================
- Hits         1030      885     -145     
+ Misses        127       99      -28     
Impacted Files Coverage Δ
src/weak.rs 75.00% <78.57%> (-8.34%) ⬇️
tests/stress.rs 94.44% <82.35%> (+0.47%) ⬆️
src/debt/list.rs 86.66% <86.66%> (ø)
src/debt/helping.rs 92.18% <92.18%> (ø)
src/debt/mod.rs 96.29% <96.29%> (ø)
src/debt/fast.rs 100.00% <100.00%> (ø)
src/lib.rs 95.69% <100.00%> (-0.31%) ⬇️
src/strategy/hybrid.rs 95.45% <100.00%> (+4.68%) ⬆️
tests/random.rs 100.00% <100.00%> (ø)
src/strategy/rw_lock.rs 0.00% <0.00%> (-3.85%) ⬇️
... and 6 more

@vorner vorner merged commit 64dcf40 into master Jan 3, 2021
@vorner vorner deleted the no-half-lock branch January 3, 2021 17:01
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.

Swap/store operation is not lock-free
2 participants