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 with read/write mutexes #27

Open
gelldur opened this issue Jun 5, 2019 · 0 comments
Open

Improve with read/write mutexes #27

gelldur opened this issue Jun 5, 2019 · 0 comments

Comments

@gelldur
Copy link
Owner

gelldur commented Jun 5, 2019

AsyncEventBus uses normal std::mutex, maybe (probably) better approach would be to use read/write mutex e.g. std::shared_mutex

We can consider adding listener as write (we can benefit of changing capacity to even improve that), and making notification as read.
This ticket needs some investigation is it possible and what need to be done to achieve better concurrency.

It would be nice to have:

  • Some performance test to compare new/old approach. Please attach results old/new to PR.
  • Unit test (if possible) of some multithreaded environment to test it.

May think about: (If you have any further suggestions please comment)

  • How to achieve single "class" to not have separate AsyncEventBus and EventBus
  • Maybe use some kind of CRTP to achieve thread safety ?
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

No branches or pull requests

1 participant