On Jun 6, 2009, at 1:25 PM, Michael McCracken wrote:
On Sat, Jun 6, 2009 at 5:33 AM, Sven-S. Porst <[email protected]> wrote:No, it's not possible to do async parsing in a web parser. Remember, we don't fully control the (async) web page loading.Can you elaborate a bit on this? It would seem advantageous to do the parsing asynchronously and so far I thought we can't do it becauseDOMDocument doesn't like running on other threads. Your comment soundslike there are further reasons for this which aren't apparent to me yet.I'm also curious. I was thinking of a limited concurrency, where the call to itemsFromDocument:... was still synchronous, but I would issue 50 (25 items per page x 2) concurrent requests to get the individual pages (for the PDF link) and their bibtex.
And then block the main thread until all of those were done? You could do that by creating 50 NSURLDownloads, then run the main thread's runloop until they're all finished. I'm not sure how many of them will actually run concurrently, since the URL loading system has its own threading.
I hadn't tried it because I wasn't sure what the slowest part was - downloading the data or parsing it.
Could you do some crude timing with NSLog to figure that out? Shark is probably overkill...
And this sounds like parsing it has to be done on the main thread? That wouldn't work so well.
BibTeXParser has a lock that prevents concurrent parsing, so you should be able to use it on any thread. Some of the shared groups do XML parsing on a secondary thread, also.
smime.p7s
Description: S/MIME cryptographic signature
------------------------------------------------------------------------------ OpenSolaris 2009.06 is a cutting edge operating system for enterprises looking to deploy the next generation of Solaris that includes the latest innovations from Sun and the OpenSource community. Download a copy and enjoy capabilities such as Networking, Storage and Virtualization. Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________ Bibdesk-develop mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/bibdesk-develop
