3 ms·
> What is it that makes a synchronous call to an out of process view on ios so bad? Because it's blocking the main thread. Worse, it's blocking the main thread
by eridius 13y ago
> What is it that makes a synchronous call to an out of process view on ios so bad?
Because it's blocking the main thread. Worse, it's blocking the main thread doing something that has effectively no upper bound on how long it can take. Web Process is blocked trying to handle a previous request to calculate Pi to a trillion digits in javascript? Oops, your synchronous call to execute more javascript will just have to wait. Indefinitely.
> Also, apple has changed the internal subviews of system views before.
I'm not talking about internals. UIWebView directly exposes its scrollView as public API. And you can muck with the view properties of the UIWebView too to make changes. For example, if you really want to you could set your UIWebView to 50% alpha (and this is totally legit, not depending on internal subview hierarchies). Whereas Remote View Controllers explicitly prevent you from mucking with any aspect of the view hierarchy.
- 0x0 13y agoIt would still be blocking the main thread if it was in-process? I'm not seeing the big deal here, at least if there's a 1:1 relationship of web views and the out of process counterparts. And it's not like ios is running a lot of foreground apps simultaneously either. Fair enough about the scrollviews, although maybe they could be proxied somehow.
- eridius 13y agoI suppose you're right in that my example of calculating pi only makes sense if you're sharing the web process with another app. But the real point, that I skipped to try and make what I thought was the more dramatic (but flawed) point, is that out-of-process requests have built-in latency that in-process requests don't. It's just plain bad design to have a synchronous API that talks to another process.
- deleted 13y ago[deleted]