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
If I call Fetch() simultaneously from multiple goroutines and the fetch func is rather slow, then it keeps being called until one of the calls returns.
So, it looks like Fetch() is not thread-safe
The text was updated successfully, but these errors were encountered:
Scratch-net
changed the title
Fetch() calls fetch func more than once
Fetch() is not atomic
Feb 12, 2021
Fetch is thread-safe in that, you aren't going to deadlock or corrupt anything within the ccache library, but the fetch func that's passed in will be called concurrently. I'm not 100% sure if this is something the library itself should handle, because it isn't clear if there's 1 correct way to handle this for all cases.
If I call Fetch() simultaneously from multiple goroutines and the fetch func is rather slow, then it keeps being called until one of the calls returns.
So, it looks like Fetch() is not thread-safe
The text was updated successfully, but these errors were encountered: