TumblrArchive/TMCache

Too many dispatch threads

iluuu1994 opened this issue · 2 comments

I'm loading some images asynchronously in a table view while scrolling.
This starts too many threads on some machines, only in some cases.

Dispatch Thread Soft Limit Reached:   64  (too many dispatch threads blocked in synchronous operations)
Dispatch Thread Hard Limit Reached:  512  (too many dispatch threads blocked in synchronous operations)

I cannot control the amount of concurrent threads, since everything is done using GCD, without heavily modifying TMCache.

Any ideas on how to resolve this?

you can maintain a request queue, and cancel request if the image is not needed anymore. and limit max request count as 3 or 5~

Closing this in favor of the numerous other issues/pull requests that migrate towards the asynchronous methods being wrappers around the synchronous ones, rather than the other way around. This should reduce thread usage.