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

Synchronize the access to LRUCache #978

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ramele1907
Copy link

  • a wizard that is creating multiple cdt projects encounters ConcurrentModificationException

- a wizard that is creating multiple cdt projects encounters ConcurrentModificationException
@jonahgraham
Copy link
Member

Hi @ramele1907 - thanks for the PR. Unfortunately the code as provided doesn't compile. See build ouput for more details.

findPathInProjectCache has some more complicated semantics as it is a map of maps, so the inner map probably needs synchronizing too. e.g. add additional Collections.synchronizedMap around the new LRUCache in findPathInProject.

Because # of reads far outweigh number of writes and you indicated that multiple projects are being created simultaneously, did you consider concurrency instead of synchronizing all accesses to the map? Those caches were added in 9e7b5be to dramatically speed up the code, and I think that adding synchronized around each read access may have an unintentional slowdown. If you can demonstrate that synchronizedMap doesn't (seriously) negatively affect performance (see the lined commit for some stats) then we don't need to consider concurrency.

It would help if there is a way to reproduce the problem so that we can see the problem in action.

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