Altova Mailing List Archives>Archive Index >xml-dev Archive Home >Recent entries >Thread Prev - Re: [xml-dev] Re: Streaming XML (WAS: More on taming SAX (was Re:[xml-dev] ANN: Amara XML Toolkit 0.9.0)) >Thread Next - Re: [xml-dev] SAX and parallel processing Re: [xml-dev] SAX and parallel processingTo: Bob Foster <bob@------.---> Date: 1/1/2005 12:59:00 AM * Bob Foster <bob@o...> [2004-12-31 19:37]:
> Bob
>
> Alan Gutierrez wrote:
> > * Bob Foster <bob@o...> [2004-12-31 18:03]:
> >>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.)
> >
> >
> >
> > Xerces recycles Attributes structures for each call to
> > startElement.
> > In my library, I keep a stack of attribute structures. The
> > attribute structures on the stack are recycled for each element
> > depth, not actually popped and reallocated.
> Right. In order to process a SAX stream in parallel you have to
> copy the data in the stream, you can't just "forward" the events.
> You also have to instantiate a context for each event, including
> at least the namespaces in scope, the Location info. I didn't mean
> to imply this would be excessively expensive, just not as
> lightweight as serially processed SAX.
Wasn't out to school you, so much as to relate my experience.
Cheers.
--
Alan Gutierrez - alan@e... | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
