-
Notifications
You must be signed in to change notification settings - Fork 23
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
Wrong choice of Lock #20
Comments
Do you understand how this current spinlock is being called recursively, which should be the origin of the deadlocks. Do you reaccess the cache from within the user function supplied to I only now notice that I never registered the latest commit, a.k.a. v1.2 , which moves all user code out of the part within which the lock is retained. Can you try whether just using master version of LRUCache fixes your problem? If so, then I would register as is, with |
I think, a yield inside the user function makes it jump out of the function and may yield to a function, that again tries to load from the Cache - that was my explanation at least, since it should be strictly non recursive code. |
But I don't think I tried the newest version, so maybe that actually fixes it (yield should make it jump to another task, so actually locking correctly with SpinLock?). |
With the latest master version the lock is freed before the user function |
Any update here? Did you find a chance to rerun your code with the master version and see if this resolves the deadlocks? |
I'll check next week ;) |
I can confirm, that master solves this issue! Let's close the issue once master is tagged! |
1.2 should be tagged now |
We were running into deadlocks with
LRUCache
, and I think it boils down toSpinLock
not being the best choice here. From the docs:Would it be possible to use
ReentrantLock
instead? It does seem to fix our issue at least.The text was updated successfully, but these errors were encountered: