-
Notifications
You must be signed in to change notification settings - Fork 89
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
[Question] Thread safety? #204
Comments
The in-memory cache stores have no synchronization mechanisms themselves so they need to be wrapped in your choice of mutex/rwlock if you are using them directly. If you are using them via the macros, then the macros automatically wrap them in the most appropriate synchronization type and the resulting functions are thread-safe. |
Is it possible to use the TimedCache with an acquired read lock from the |
Thank you @jaemk @squadgazzz I think I ran into the same problem. The ref must be mutable probably because evictions are processed during read operations. |
Are caches like
cached::stores::TimedCache
thread safe on their own or should I wrap them in a RwLock?What about if I use the cache macro on a function? Is that function thread-safe?
The text was updated successfully, but these errors were encountered: