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
I noticed this issue when trying to cache a number of images at the same time in my own project and was able to recreate it in a sample project by simply requesting lots of object lookups in quick succession:
Basically, TMCache has been using TMMemoryCache with a synchronous call to objectForKey:, which should theoretically be fine because it's happening on another queue (that is, until it's waiting for more objects than there are threads and they all get blocked).
The fix was to switch everything in objectForKey: to asynchronous calls, which is messier but ultimately safer and avoids this problem. I've also added a unit test to hopefully catch this if it happens in the future. Here's the commit: e44251f
I noticed this issue when trying to cache a number of images at the same time in my own project and was able to recreate it in a sample project by simply requesting lots of object lookups in quick succession:
I would expect the above to output:
but it generally drops out after 1 or 2, or sometimes doesn't respond at all.
By switching:
in TMCache.m:33 with:
I was able to get the cache responding as expected but this may have other side effects that I am unaware of. Any thoughts?
The text was updated successfully, but these errors were encountered: