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

Improve mutex usage #154

Merged
merged 2 commits into from
Feb 9, 2023
Merged

Improve mutex usage #154

merged 2 commits into from
Feb 9, 2023

Conversation

achim-k
Copy link
Collaborator

@achim-k achim-k commented Feb 8, 2023

Public-Facing Changes

  • Improves mutex usage for better concurrency

Description

  • Splits up _clientsChannelMutex into _clientsMutex and _channelsMutex
  • Adds _clientChannelsMutex for protecting client channels

sendJson(hdl, {
{"op", "advertise"},
{"channels", std::move(channels)},
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be modified to move the sendJson call outside of the lock? Declare std::vector<Channel> channels; above and only populate it inside the lock.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yap, that makes sense. Will do

sendJson(hdl, {
{"op", "advertiseServices"},
{"services", std::move(services)},
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same question/comment here

@achim-k achim-k enabled auto-merge (squash) February 9, 2023 13:27
@achim-k achim-k merged commit b154b6c into main Feb 9, 2023
@achim-k achim-k deleted the achim/mutex_improvements branch February 9, 2023 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants