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

Remove unnecessary synchronization from endpoint reader/writer caches #167

Merged
merged 2 commits into from
Jan 18, 2023

Conversation

pjfanning
Copy link
Member

@pjfanning pjfanning commented Jan 17, 2023

  • relates to ProviderBase class shows contention on synchronized block using LRUMap _writers instance #166
  • current synchronization does not prevent concurrent threads finding there are no cached instances and then multiple threads can create instances - once an instance is cached, then this will no longer happen
  • if we want proper control so that concurrent threads can't create multiple instances, we could look at LRUMap and introduce something like Map.computeIfAbsent

@cowtowncoder
Copy link
Member

@pjfanning LGTM. Just one question -- I think this should be safe enough to include in 2.14.2? If you agree could you re-base against 2.14 branch. I'll be happy to merge either way.

@pjfanning pjfanning changed the base branch from 2.15 to 2.14 January 17, 2023 23:51
@pjfanning
Copy link
Member Author

let me rebase the branch to v2.14

@pjfanning pjfanning force-pushed the remove-unnecessary-synchronization branch from b5a6111 to 756d95c Compare January 17, 2023 23:55
@pjfanning
Copy link
Member Author

@cowtowncoder rebased

@cowtowncoder cowtowncoder changed the title remove unnecessary synchronization Remove unnecessary synchronization from endpoint reader/writer caches Jan 18, 2023
@cowtowncoder cowtowncoder added this to the 2.14.2 milestone Jan 18, 2023
@cowtowncoder cowtowncoder merged commit ac6174c into 2.14 Jan 18, 2023
@cowtowncoder cowtowncoder deleted the remove-unnecessary-synchronization branch January 18, 2023 02:06
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.

2 participants