Skip to content
Discussion options

You must be logged in to vote

Hi @oconnor0 , currently a lock cannot be acquired twice (see: re-entrancy) by the same subject.
So yes, trying to do that will inadvertently get into a deadlock.

Currently in FusionCache the component responsible for it is the StandardDistributedLocker (default implementation of the IFusionCacheMemoryLocker core abstraction), which internally uses a series of SemaphoreSlims.

I thought about thsi in the past, but I've never been sure if it was possible at all, at least considering all the constraints:

  • must support both sync and async
  • must support acquisition timeouts
  • timeout can even be zero (e.g.: TimeSpan.Zero), because it's used for Eager Refresh and other stuff

Also, there's this.

O…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@oconnor0
Comment options

Answer selected by oconnor0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants