开发者

Should NSURLProtocol::startLoading be asynch

开发者 https://www.devze.com 2023-02-21 15:18 出处:网络
I am subcla开发者_开发技巧ssing NSURLProtocol. Do get parallel performance, need I spawn the loading to a separate thread in startLoading, or is this handled for me by the URL loading framework (Web

I am subcla开发者_开发技巧ssing NSURLProtocol.

Do get parallel performance, need I spawn the loading to a separate thread in startLoading, or is this handled for me by the URL loading framework (WebKit)?


This is handled for you by the URL Loading System.


Actually. I found that if your -startLoading method takes too much time (where too much can already be just loading a file from the filesystem), you get weird crashes with stacktraces which are completely unhelpful.

The only way to battle this is to dispatch_async yourself first thing and do any non-trivial work there.

0

精彩评论

暂无评论...
验证码 换一张
取 消