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

Concurrent insertable vector #188

Merged
merged 1 commit into from
Oct 30, 2023
Merged

Conversation

hkadayam
Copy link
Contributor

This data structure provides a vector where concurrent threads can safely emplace or push back the data into. However, it does not guarantee any access or iterations happen during the insertion. It is the responsibility of the user to synchronize this behavior. This data structure is useful when the user wants to insert data into a vector concurrently in a fast manner and then iterate over the data later. If the user wants a vector implementation which reads concurrently with writer, they can use sisl::ThreadVector. This data structure is provided as a replacement for simplistic cases where insertion and iteration never happen concurrently. As a result it provides better performance than even sisl::ThreadVector and better debuggability.

Benchmark shows atleast 10x better performance on more than 4 threads concurrently inserting with mutex.

Justification for this data structure: As mentioned sisl::ThreadVector uses RCU to protect concurrent read and write. However if the caller already guarantees that with RCU it is faster and less issues to chase down (and more simpler). That is the case for Homestore writeback cache dirty buffer accumulation.

@hkadayam hkadayam requested review from szmyd and sanebay October 26, 2023 20:51
@codecov-commenter
Copy link

codecov-commenter commented Oct 26, 2023

Codecov Report

Merging #188 (9f43022) into master (91a6835) will decrease coverage by 0.73%.
The diff coverage is 90.62%.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #188      +/-   ##
==========================================
- Coverage   64.14%   63.41%   -0.73%     
==========================================
  Files          70       71       +1     
  Lines        4287     4319      +32     
  Branches      538      543       +5     
==========================================
- Hits         2750     2739      -11     
- Misses       1301     1336      +35     
- Partials      236      244       +8     
Components Coverage Δ
AuthManager 77.77% <ø> (ø)
Cache 21.84% <ø> (-6.97%) ⬇️
FDS 70.47% <90.62%> (+0.29%) ⬆️
FileWatcher 55.90% <ø> (ø)
Flip 65.67% <ø> (ø)
gRPC 77.66% <ø> (ø)
Logging 29.33% <ø> (ø)
Metrics 80.54% <ø> (ø)
Options 100.00% <ø> (ø)
Setting 57.98% <ø> (ø)
StatusObject 73.83% <ø> (ø)
Utility 84.91% <ø> (ø)
Version 95.83% <ø> (ø)

@hkadayam hkadayam requested review from szmyd and sanebay October 30, 2023 15:10
@hkadayam hkadayam requested a review from szmyd October 30, 2023 16:01
@hkadayam hkadayam merged commit b45862d into eBay:master Oct 30, 2023
4 checks passed
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.

4 participants