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

LRUCache has Concurrency problem #786

Open
looly opened this issue Feb 17, 2022 · 5 comments
Open

LRUCache has Concurrency problem #786

looly opened this issue Feb 17, 2022 · 5 comments

Comments

@looly
Copy link

looly commented Feb 17, 2022

Current behavior

Hello, I found the class: LRUCache

use LinkedHashMap and use read lock for get, but the LinkedHashMap get method is not thread safe, the element will move to last of queue when get it.

image

@igr
Copy link
Member

igr commented Feb 19, 2022

True! the thing is that the cache utilities were not migrated to the https://github.com/oblac/jodd-util.

I am under impression that there are better cache libraries out there... not sure if we should maintain this one anymore?

@looly
Copy link
Author

looly commented Feb 20, 2022

U means that cache will be removed next time?

@igr
Copy link
Member

igr commented Feb 22, 2022

It already is :) If you take a look in the https://github.com/oblac/jodd-util there is no cache anymore...

But I am open for discussion!

@igr
Copy link
Member

igr commented Feb 22, 2022

So, wdyt @looly ? Would such a small cache make sense?

@looly
Copy link
Author

looly commented Feb 22, 2022

Un.... not sense.

I mean if some user use the old version jodd-all will be touch off the bug,and its very difficut to find out it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants