You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi guys,
Does anyone know if currently this library can allow multiple threads to keep read data from cache, while some other threads update cache existing key with new value ?
or multiple threads will be blocked when try to read before new value become available.
The text was updated successfully, but these errors were encountered:
phadtrapong
changed the title
Question About Cache availability mechanism
About Cache availability mechanism
Mar 24, 2022
Sorry for the slow reply. It depends on how you add the new value to the cache. Say you have Version 1 of Item in the cache. Other threads can read Version 1. If you generate Version 2 on another thread outside of LazyCache and then cache the result with CachingService.Add then the update would be almost instant and no thread would be blocked - they just get Version 1 or Version 2 depending on the time of the read.
If you use the expiration to trigger repopulation then threads that read between expiration and regeneration completion would then be blocked, more info at https://github.com/alastairtree/LazyCache/wiki/API-documentation-(v-2.x)#using-immediateexpiration-and-registerpostevictioncallback-to-refresh-a-cached-item-automatically
Hi guys,
Does anyone know if currently this library can allow multiple threads to keep read data from cache, while some other threads update cache existing key with new value ?
or multiple threads will be blocked when try to read before new value become available.
The text was updated successfully, but these errors were encountered: