[Home] [By Thread] [By Date] [Recent Entries]

  • To: xml-dev@l...
  • Subject: Stopping and resuming a sax parser?
  • From: "Bernd G." <gbernd@g...>
  • Date: Fri, 17 Dec 2004 15:24:23 +0100
  • User-agent: KMail/1.7.2

Hi,

is there a way (an API) to stop and resume a SAX parser?

I'm writing a trace feeder for an event driven simulation in C++. Doing this, 
I have the problem that there are two concurrent control flows: one of the 
simulation calendar generating simulation events saying "read the next 
element from the trace file" and the other of the SAX parser running through 
the XML document and generating the well known SAX events.

One solution would be to put the SAX parser into an own thread and block it in 
the StartElement method by synchronizing it with simulation events using 
mutex variables.

A nicer solution would be, if I could stop and resume the SAX parser by 
methods called from within the StartElement method and from outside. I would 
prefer such a solution since the trace files are expected to be really large, 
i.e. with millions of elements, and I worry about the performance of so many 
task changes.

Any tips?

cheers
 Bernd

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member