You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-users@xerces.apache.org by Keith Mendoza <ke...@panasonic.aero> on 2007/07/06 17:07:27 UTC
Xerces DOM Multithread issue
Hi,
I just want to make sure that I understand the answer to the "Is
Xerces-C++ thread safe?" FAQ.
I'm going to use a code snippet to show what I'm trying to get at
XercesDOMParser *parser = new XercesDOMParser;
parser->parse(myFile);
DOMDocument *xmlDoc = parser->getDocument();
DOMElement *rootElement = xmlDoc->getDocumentElement();
DOMNodeList *nodeList = rootElement->getElementsByTagName(nodeName);
If my thread-spawned function that contains the following lines (where
pos = 1 on the first thread and pos = 2 on the second thread)
DOMNode *workOnNode nodeList->item(pos);
DOMElement *threadElement = dynamic_cast<DOMElement *>(workOnNode);
This would not work if both threads try to access nodeList at the same
time since there's only one instance of the DOM document.
Is my understanding correct?
Thanks
Disclaimer: The information contained in this transmission, including any
attachments, may contain confidential information of Panasonic Avionics
Corporation. This transmission is intended only for the use of the
addressee(s) listed above. Unauthorized review, dissemination or other use
of the information contained in this transmission is strictly prohibited.
If you have received this transmission in error or have reason to believe
you are not authorized to receive it, please notify the sender by return
email and promptly delete the transmission.