[xsd-users] Reentrant parser?
mhoffm1060 at aol.com
mhoffm1060 at aol.com
Fri Mar 30 14:09:37 EDT 2007
Boris,
That took care of it.
Thanks for your quick response.
Mark
-----Original Message-----
From: boris at codesynthesis.com
To: mhoffm1060 at aol.com
Cc: xsd-users at codesynthesis.com
Sent: Fri, 30 Mar 2007 10:30 AM
Subject: Re: [xsd-users] Reentrant parser?
Hi Mark,
mhoffm1060 at aol.com <mhoffm1060 at aol.com> writes:
> I was wondering if the xml parsing method ( for istreams ) is reentrant?
Yes, it is.
> ( Or does each call to the method use the same instance of the Xerces
> parser? )
No, each call creates a new parser.
> Basically I have an object that can potentially try to parse two XML
> files in different thread contexts, and it is crashing in the Xerces DLL ).
You will need to call xercesc::XMLPlatformUtils::Initialize() and
xercesc::XMLPlatformUtils::Terminate() in your main() as well as
pass the xml_schema::flags::dont_initialize to the parsing function.
Xerces-C++ Initialize() and Terminate() are not safe to call from
separate threads and that's exactly what may happen when you call
one of the parsing functions from two different threads.
hth,
-boris
________________________________________________________________________
AOL now offers free email to everyone. Find out more about what's free from AOL at AOL.com.
More information about the xsd-users
mailing list