-
Notifications
You must be signed in to change notification settings - Fork 401
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
iox-#2177 Update SPSC SoFi #2214
Conversation
iceoryx_hoofs/concurrent/buffer/include/iox/detail/spsc_sofi.inl
Outdated
Show resolved
Hide resolved
iceoryx_hoofs/concurrent/buffer/include/iox/detail/spsc_sofi.inl
Outdated
Show resolved
Hide resolved
From #2178 (comment)
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2214 +/- ##
==========================================
- Coverage 78.22% 78.21% -0.01%
==========================================
Files 433 433
Lines 16041 16033 -8
Branches 2301 2299 -2
==========================================
- Hits 12548 12541 -7
Misses 2647 2647
+ Partials 846 845 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for letting you wait so long for the review. I needed a fresh mind to review lock-free code :)
iceoryx_hoofs/concurrent/buffer/include/iox/detail/spsc_sofi.hpp
Outdated
Show resolved
Hide resolved
iceoryx_hoofs/concurrent/buffer/include/iox/detail/spsc_sofi.hpp
Outdated
Show resolved
Hide resolved
iceoryx_hoofs/concurrent/buffer/include/iox/detail/spsc_sofi.hpp
Outdated
Show resolved
Hide resolved
iceoryx_hoofs/concurrent/buffer/include/iox/detail/spsc_sofi.hpp
Outdated
Show resolved
Hide resolved
iceoryx_hoofs/concurrent/buffer/include/iox/detail/spsc_sofi.hpp
Outdated
Show resolved
Hide resolved
iceoryx_hoofs/concurrent/buffer/include/iox/detail/spsc_sofi.inl
Outdated
Show resolved
Hide resolved
iceoryx_hoofs/concurrent/buffer/include/iox/detail/spsc_sofi.inl
Outdated
Show resolved
Hide resolved
iceoryx_hoofs/concurrent/buffer/include/iox/detail/spsc_sofi.inl
Outdated
Show resolved
Hide resolved
iceoryx_hoofs/concurrent/buffer/include/iox/detail/spsc_sofi.inl
Outdated
Show resolved
Hide resolved
iceoryx_hoofs/concurrent/buffer/include/iox/detail/spsc_sofi.inl
Outdated
Show resolved
Hide resolved
1892aa0
to
8cc9277
Compare
@albtam just to be sure that you are not waiting on feedback. I'll wait until the CI (at least the github actions) are green. |
@elBoberido Back to you |
iceoryx_hoofs/concurrent/buffer/include/iox/detail/spsc_sofi.hpp
Outdated
Show resolved
Hide resolved
iceoryx_hoofs/concurrent/buffer/include/iox/detail/spsc_sofi.hpp
Outdated
Show resolved
Hide resolved
iceoryx_hoofs/concurrent/buffer/include/iox/detail/spsc_sofi.hpp
Outdated
Show resolved
Hide resolved
iceoryx_hoofs/concurrent/buffer/include/iox/detail/spsc_sofi.hpp
Outdated
Show resolved
Hide resolved
iceoryx_hoofs/concurrent/buffer/include/iox/detail/spsc_sofi.hpp
Outdated
Show resolved
Hide resolved
iceoryx_hoofs/concurrent/buffer/include/iox/detail/spsc_sofi.inl
Outdated
Show resolved
Hide resolved
iceoryx_hoofs/concurrent/buffer/include/iox/detail/spsc_sofi.inl
Outdated
Show resolved
Hide resolved
iceoryx_hoofs/concurrent/buffer/include/iox/detail/spsc_sofi.inl
Outdated
Show resolved
Hide resolved
iceoryx_hoofs/concurrent/buffer/include/iox/detail/spsc_sofi.inl
Outdated
Show resolved
Hide resolved
@elBoberido Thanks. I addressed most of your comments. There are still some points to clarify |
@albtam you can undo some of my suggestions 😅 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This somehow becomes a never ending story but with the revert of the relaxed
ordering in the places where acq_rel
was required, we might be able to relax some of the acquire
orderings. Unfortunately this is something which is hard to see when there are too many wrong orderings but once the ordering is at least as strong as required, we can identify the locations which definitely need the strong ordering and can try to relax some orderings which act as sync points when we identify new sync points or change the algorithm a bit.
iceoryx_hoofs/concurrent/buffer/include/iox/detail/spsc_sofi.inl
Outdated
Show resolved
Hide resolved
I pushed some of your proposals. There is still something unclear. Lock-free is hard :P |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, lock-free is hard 😅
Btw, can you please adjust your commit messages with the issue number.
Before this is merged, it would be good to run test_stress_spsc_sofi
. Ideally each of the three test for a few hours. The stress time can only be adjusted in the source code.
iceoryx_hoofs/concurrent/buffer/include/iox/detail/spsc_sofi.inl
Outdated
Show resolved
Hide resolved
iceoryx_hoofs/concurrent/buffer/include/iox/detail/spsc_sofi.inl
Outdated
Show resolved
Hide resolved
eedfddc
to
04837bb
Compare
@elBoberido I implemented your last recommendations. |
@albtam sorry, this totally slipped my attention. The changes look good. Did you have a chance to run the stress tests? |
@albtam did you have the chance to run the stress tests on an aarch64 CPU? |
@elBoberido Sorry for the delay. I ran the stress tests (on x64 CPU). This test failed SpscSofiStress.SimultaneouslyPushAndPopOnEmptySoFi (both on master and my branch). I don't have an aarch64 CPU, would it be possible for you to run the tests? |
@albtam I can run it for you on my mac |
If it runs without error on the mac, then this can be merged. But before it needs to be rebased. There is now an abstraction for the atomics which leads to a merge conflict. It should be easily solved, though. @albtam can you post the output of the stress tests. I've run main and your branch and didn't encounter an error. |
- add comments to clarify concurrent behavior - fix memory orders
04837bb
to
081d5f2
Compare
Thanks
I reran them and everything's fine. I fixed the conflicts. Back to you |
@albtam thanks for your contribution :) |
Pre-Review Checklist for the PR Author
iox-123-this-is-a-branch
)iox-#123 commit text
)task-list-completed
)iceoryx_hoofs
are added to./clang-tidy-diff-scans.txt
Notes for Reviewer
I updated some memory orders and updated the comments to make sure future contributors understand the changes
Checklist for the PR Reviewer
iceoryx_hoofs
have been added to./clang-tidy-diff-scans.txt
Post-review Checklist for the PR Author
References