[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: SAX and parallel processing


sax threads
Yes, thanks for that.

I have a question, though. What is the guaranteed lifetime of an object 
appearing in a SAX event, like an Attributes object, and any objects 
used to implement it? If, for example, Attributes were implemented as a 
collection of lightweight Attribute objects that were re-used for 
subsequent events, the event data could not be passed directly to 
parallel threads without copying it. (Or by joining at the end of every 
event, which would rather limit the parallelism.)

Bob Foster

David Megginson wrote:
 > I think that there's been a terrible amount of confusion on this thread.
 >
 > As soon as the filter pipeline design pattern started to become
 > popular for applications based on SAX1, I assumed that people would
 > insert tee-joints in the pipeline to allow for parallel processing
 > when they needed it, especially since thread management in Java is so
 > easy.  Note that we're talking about parallel threads performing
 > different operations on the *same* sequential event stream (i.e. one
 > thread might be populating a database, while another is producing an
 > HTML page).  I can also conceive of applications where different
 > threads deal with different parts of the document, as long as the
 > source event stream stays single-thread and sequential -- for example,
 > a filter might divert a series of events representing a document
 > subtree to a separate thread that builds a data structure and performs
 > time-consuming operations while the rest of the event stream continues
 > on to the original thread (which was briefly suspended waiting for
 > more input).
 >
 > So the source of the SAX event stream has to be sequential, but
 > there's no reason that the rest of the filter pipeline cannot be
 > parallelized.
 >
 >
 > All the best,
 >
 >
 > David
 >



PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.