Skip to content

Commit

Permalink
fix: reduce lock contention in distributor channels (#10026)
Browse files Browse the repository at this point in the history
* fix: lock contention in distributor channels

Reduce lock contention in distributor channels via:

- use atomic counters instead of "counter behind mutex" where
  appropriate
- use less state
- only lock when needed
- move "wake" operation out of lock scopes (they are eventual operations
  anyways and many wake operations results in "futex wake" operations --
  i.e. a syscall -- which you should avoid while holding the lock)

* refactor: add more docs and tests for distributor channels

---------

Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
  • Loading branch information
crepererum and alamb authored Apr 25, 2024
1 parent 7dae9ab commit b87f210
Showing 1 changed file with 245 additions and 113 deletions.
Loading

0 comments on commit b87f210

Please sign in to comment.