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

Refax: added size cache to the group container #2510

Merged

Conversation

ethouris
Copy link
Collaborator

@ethouris ethouris commented Nov 1, 2022

This adds a size cache to the group container.

The group container is std::list and as such it doesn't have its own saved cache. There were two reasons to add this:

  1. In some future implementations the call to the container's size() can be even very often, while std::list original size() is linear time in the number of members.
  2. There will be also situations when the size is needed to be taken without locking the group's mutex. With this cache the size can be directly taken from the cache, and as atomic, it doesn't need to be mutex-locked.

@maxsharabayko maxsharabayko added Type: Maintenance Work required to maintain or clean up the code [core] Area: Changes in SRT library core labels Nov 7, 2022
@maxsharabayko maxsharabayko added this to the v1.6.0 milestone Nov 7, 2022
@maxsharabayko maxsharabayko merged commit 258a858 into Haivision:master Nov 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[core] Area: Changes in SRT library core Type: Maintenance Work required to maintain or clean up the code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants