-
Notifications
You must be signed in to change notification settings - Fork 110
Compressing "Youtube video + controls" screenshot takes forever; prevents home tiles from appearing #610
Comments
Another problem with the existing code: the common thread pool has a limited size so when we block it on IO, we're unable to run other coroutines until these methods return – ouch! Concurrency is hard! |
In #627, I mitigated this with fine-grain locking. For this bug, we may want to consider:
|
This mitigates mozilla-mobile#610, where the whole screenshot store can wait on a single write, preventing custom home tiles from being shown.
This mitigates #610, where the whole screenshot store can wait on a single write, preventing custom home tiles from being shown.
[triage] This is much less urgent to fix with the mitigation ^. |
I was under the impression that coroutines are unlimited. You can have tens of thousands of them spawned at once... |
@IgorGanapolsky The number of coroutines you can create is nearly limitless but the number of coroutines actually executing simultaneously is limited. If a coroutine runs a blocking method, like file or network IO, it blocks the thread it's running on. The default dispatcher, As a one way around this, there are some coroutine wrappers (which I assume suspend instead of block) around around Java 7's non-blocking io packages: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-nio/ |
STR:
Expected: Tile appears with screenshot of youtube
Actual: All custom tiles hang for several seconds (twenty?)
Compressing the screenshot to disk is the operation taking a while, which locks the screenshots file system. Since we block titles showing on screenshots, no tiles are shown. Thoughts:
Realistic solutions:
I think we should probably just switch to JPEG or try removing transparency from screenshots, assuming that fixes the problem.
The text was updated successfully, but these errors were encountered: