Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Multithreaded XML file parsing?



I doubt you will be able to gain much performance trying to split the file and use multiple threads to parse the file. You'll waste a lot of time trying to split the XML into separate valid documents. However, if you're using SAX, you could easily spawn threads in your handlers to do whatever you need to do with the XML data. This way the parser will go through the document as quickly as possible letting your handlers work asynchronously. This could be difficult to synchronize if your handlers are dependent on each other for data, however...

- Erik Mattheis
  email@hidden

On Aug 17, 2006, at 10:48 PM, Saad Mahamood wrote:

Hello,

I was wondering if it is possible to split a very large XML file (100
megabytes) into several smaller size chunks and then run several SAX
parsing threads on each of the chunks? The problem I having trying to
conceptualise in mind is how to avoid the situation where I split the
large XML file in the wrong place and thus leaving two of the threads
with incomplete information. I reckon I need to run a pre-processor on
the file to determine where to spilt it....

Thanks in advance for any ideas or pointers.

Cheers,

Saad..
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden

_______________________________________________ Do not post admin requests to the list. They will be ignored. Java-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden
References: 
 >Multithreaded XML file parsing? (From: "Saad Mahamood" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.