Should NSURLProtocol::startLoading be asynch
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.
精彩评论